Ticket #789 (closed defect: fixed)

Opened 2 weeks ago

Last modified 2 weeks ago

/etc/defaults oddness

Reported by: lueningh Owned by: solj
Priority: major Milestone: Bcfg2 1.0.1 Release
Component: bcfg2-client Version: 1.0
Keywords: Cc: solj@…

Description

After building an RPM of the bcfg 1.0.0 source and installing it on a fresh server, I couldn't start it up and it wasn't immediately obvious how to fix it:

mgt5:/var/lib/bcfg2 # /etc/init.d/bcfg2-server start
bcfg2-server is disabled - see /etc/default/bcfg2-server      failed
mgt5:/var/lib/bcfg2 # ls /etc/default/bcfg2-server
ls: /etc/default/bcfg2-server: No such file or directory

Looks like that file needs to be added to the packaging.

Attachments

Change History

  Changed 2 weeks ago by solj

We need to change the message on redhat machines to tell the user to look at /etc/sysconfig instead of /etc/default.

  Changed 2 weeks ago by solj

  • cc solj@… added

in reply to: ↑ description ; follow-up: ↓ 4   Changed 2 weeks ago by solj

Replying to lueningh:

After building an RPM of the bcfg 1.0.0 source and installing it on a fresh server, I couldn't start it up and it wasn't immediately obvious how to fix it: {{{ mgt5:/var/lib/bcfg2 # /etc/init.d/bcfg2-server start bcfg2-server is disabled - see /etc/default/bcfg2-server failed mgt5:/var/lib/bcfg2 # ls /etc/default/bcfg2-server ls: /etc/default/bcfg2-server: No such file or directory }}} Looks like that file needs to be added to the packaging.

Does this help any

diff --git a/redhat/bcfg2.spec.in b/redhat/bcfg2.spec.in
index 31351b1..e44ff34 100644
--- a/redhat/bcfg2.spec.in
+++ b/redhat/bcfg2.spec.in
@@ -85,15 +85,15 @@ Configuration management server
 %setup -q -n %{name}-%{version}-%{release}

 # fixup some paths
-%{__perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' debian/bcfg2.init
+%{__perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' redhat/scripts/bcfg2.init
 %{__perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' tools/bcfg2-cron

 %{__perl} -pi -e 's@/usr/lib/bcfg2@%{_libexecdir}@g' debian/bcfg2.cron.daily
 %{__perl} -pi -e 's@/usr/lib/bcfg2@%{_libexecdir}@g' debian/bcfg2.cron.hourly

 # don't start servers by default
-%{__perl} -pi -e 's@chkconfig: (\d+)@chkconfig: -@' debian/bcfg2.init
-%{__perl} -pi -e 's@chkconfig: (\d+)@chkconfig: -@' debian/bcfg2-server.init
+%{__perl} -pi -e 's@chkconfig: (\d+)@chkconfig: -@' redhat/scripts/bcfg2.init
+%{__perl} -pi -e 's@chkconfig: (\d+)@chkconfig: -@' redhat/scripts/bcfg2-server.init

 # get rid of extraneous shebangs
 for f in `find src/lib -name \*.py`

in reply to: ↑ 3 ; follow-up: ↓ 5   Changed 2 weeks ago by lueningh

That seems to be doing the same thing for me...

Replying to solj:

Replying to lueningh:

After building an RPM of the bcfg 1.0.0 source and installing it on a fresh server, I couldn't start it up and it wasn't immediately obvious how to fix it: {{{ mgt5:/var/lib/bcfg2 # /etc/init.d/bcfg2-server start bcfg2-server is disabled - see /etc/default/bcfg2-server failed mgt5:/var/lib/bcfg2 # ls /etc/default/bcfg2-server ls: /etc/default/bcfg2-server: No such file or directory }}} Looks like that file needs to be added to the packaging.

Does this help any {{{ diff --git a/redhat/bcfg2.spec.in b/redhat/bcfg2.spec.in index 31351b1..e44ff34 100644 --- a/redhat/bcfg2.spec.in +++ b/redhat/bcfg2.spec.in @@ -85,15 +85,15 @@ Configuration management server %setup -q -n %{name}-%{version}-%{release} # fixup some paths -%{perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' debian/bcfg2.init +%{perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' redhat/scripts/bcfg2.init %{perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' tools/bcfg2-cron %{perl} -pi -e 's@/usr/lib/bcfg2@%{_libexecdir}@g' debian/bcfg2.cron.daily %{perl} -pi -e 's@/usr/lib/bcfg2@%{_libexecdir}@g' debian/bcfg2.cron.hourly # don't start servers by default -%{perl} -pi -e 's@chkconfig: (\d+)@chkconfig: -@' debian/bcfg2.init -%{perl} -pi -e 's@chkconfig: (\d+)@chkconfig: -@' debian/bcfg2-server.init +%{perl} -pi -e 's@chkconfig: (\d+)@chkconfig: -@' redhat/scripts/bcfg2.init +%{perl} -pi -e 's@chkconfig: (\d+)@chkconfig: -@' redhat/scripts/bcfg2-server.init # get rid of extraneous shebangs for f in find src/lib -name \*.py }}}

in reply to: ↑ 4 ; follow-up: ↓ 7   Changed 2 weeks ago by solj

Replying to lueningh:

That seems to be doing the same thing for me...

In that case, maybe we should unify the behavior across distros and have the redhat packages ship with the configuration in /etc/default as well. Does this work?

diff --git a/redhat/bcfg2.spec.in b/redhat/bcfg2.spec.in
index 31351b1..67a4bac 100644
--- a/redhat/bcfg2.spec.in
+++ b/redhat/bcfg2.spec.in
@@ -85,9 +85,6 @@ Configuration management server
 %setup -q -n %{name}-%{version}-%{release}

 # fixup some paths
-%{__perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' debian/bcfg2.init
-%{__perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' tools/bcfg2-cron
-
 %{__perl} -pi -e 's@/usr/lib/bcfg2@%{_libexecdir}@g' debian/bcfg2.cron.daily
 %{__perl} -pi -e 's@/usr/lib/bcfg2@%{_libexecdir}@g' debian/bcfg2.cron.hourly

@@ -113,7 +110,7 @@ mkdir -p %{buildroot}%{_sbindir}
 mkdir -p %{buildroot}%{_initrddir}
 mkdir -p %{buildroot}%{_sysconfdir}/cron.daily
 mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly
-mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
+mkdir -p %{buildroot}%{_sysconfdir}/default
 mkdir -p %{buildroot}%{_libexecdir}
 mkdir -p %{buildroot}%{_var}/lib/bcfg2
 mkdir -p %{buildroot}%{_var}/cache/bcfg2
@@ -126,7 +123,7 @@ install -m 755 debian/bcfg2.cron.daily %{buildroot}%{_sysconfdir}/cron.daily/bcf
 install -m 755 debian/bcfg2.cron.hourly %{buildroot}%{_sysconfdir}/cron.hourly/bcfg2
 install -m 755 tools/bcfg2-cron %{buildroot}%{_libexecdir}/bcfg2-cron

-install -m 644 debian/bcfg2.default %{buildroot}%{_sysconfdir}/sysconfig/bcfg2
+install -m 644 debian/bcfg2.default %{buildroot}%{_sysconfdir}/default/bcfg2

 touch %{buildroot}%{_sysconfdir}/bcfg2.conf
 touch %{buildroot}%{_sysconfdir}/bcfg2.key
@@ -168,7 +165,7 @@ fi

 %ghost %attr(600,root,root) %config(noreplace) %{_sysconfdir}/bcfg2.conf

-%config(noreplace) %{_sysconfdir}/sysconfig/bcfg2
+%config(noreplace) %{_sysconfdir}/default/bcfg2
 %{_sysconfdir}/cron.daily/bcfg2
 %{_sysconfdir}/cron.hourly/bcfg2

  Changed 2 weeks ago by solj

  • owner changed from desai to solj
  • status changed from new to accepted

in reply to: ↑ 5   Changed 2 weeks ago by lueningh

That didn't make any difference either. Looking more closely at the patch, though, I have a new question: I'm building with "rpmbuild -ta bcfg-1.0.0.tar.gz", and I bet that is finding the bcfg2.spec file that exists in the misc/ directory. Is there a "correct" way to recreate the spec file from the spec.in and get it in the right place?

Replying to solj:

Replying to lueningh:

That seems to be doing the same thing for me...

In that case, maybe we should unify the behavior across distros and have the redhat packages ship with the configuration in /etc/default as well. Does this work? {{{ diff --git a/redhat/bcfg2.spec.in b/redhat/bcfg2.spec.in index 31351b1..67a4bac 100644 --- a/redhat/bcfg2.spec.in +++ b/redhat/bcfg2.spec.in @@ -85,9 +85,6 @@ Configuration management server %setup -q -n %{name}-%{version}-%{release} # fixup some paths -%{perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' debian/bcfg2.init -%{perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' tools/bcfg2-cron - %{perl} -pi -e 's@/usr/lib/bcfg2@%{_libexecdir}@g' debian/bcfg2.cron.daily %{perl} -pi -e 's@/usr/lib/bcfg2@%{_libexecdir}@g' debian/bcfg2.cron.hourly @@ -113,7 +110,7 @@ mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_initrddir} mkdir -p %{buildroot}%{_sysconfdir}/cron.daily mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly -mkdir -p %{buildroot}%{_sysconfdir}/sysconfig +mkdir -p %{buildroot}%{_sysconfdir}/default mkdir -p %{buildroot}%{_libexecdir} mkdir -p %{buildroot}%{_var}/lib/bcfg2 mkdir -p %{buildroot}%{_var}/cache/bcfg2 @@ -126,7 +123,7 @@ install -m 755 debian/bcfg2.cron.daily %{buildroot}%{_sysconfdir}/cron.daily/bcf install -m 755 debian/bcfg2.cron.hourly %{buildroot}%{_sysconfdir}/cron.hourly/bcfg2 install -m 755 tools/bcfg2-cron %{buildroot}%{_libexecdir}/bcfg2-cron -install -m 644 debian/bcfg2.default %{buildroot}%{_sysconfdir}/sysconfig/bcfg2 +install -m 644 debian/bcfg2.default %{buildroot}%{_sysconfdir}/default/bcfg2 touch %{buildroot}%{_sysconfdir}/bcfg2.conf touch %{buildroot}%{_sysconfdir}/bcfg2.key @@ -168,7 +165,7 @@ fi %ghost %attr(600,root,root) %config(noreplace) %{_sysconfdir}/bcfg2.conf -%config(noreplace) %{_sysconfdir}/sysconfig/bcfg2 +%config(noreplace) %{_sysconfdir}/default/bcfg2 %{_sysconfdir}/cron.daily/bcfg2 %{_sysconfdir}/cron.hourly/bcfg2 }}}

  Changed 2 weeks ago by desai

  • status changed from accepted to closed
  • resolution set to fixed

Fixed in [5556]

Add/Change #789 (/etc/defaults oddness)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.