chkconfig woes
14 Dec 2009Irritating: chkconfig
on RHEL/CentOS returns non-zero if a service
isn't configured for a runlevel. IOW, you can do:
chkconfig --level 3 foo
and have 0 returned if it's on, 1 if it's not.
But not SuSE; nope, it just returns 0 whether or not it's enabled, or
even if the service itself doesn't exist. Because, you know, grep
doesn't get used enough.
I'm doing this because I'm trying to use cfengine 2 to manage services. This works well in CentOS, where you can add something like:
service_foo_on = (ReturnsZero("/sbin/chkconfig --level 3 foo"))
and it'll work. ("servicefooon" is a bit of a misnomer, because I'm checking runlevels, not whether it's actually running.)
Update: Nope, I'm wrong. chkconfig --check
does exactly what I
want. Many thanks to yaloki on #openSUSE-server for the help.
Add a comment:
Name and email required; email is not displayed.
Related Posts
QRP weekend 08 Oct 2018
Open Source Cubesat Workshop 2018 03 Oct 2018
mpd crash? try removing files in /var/lib/mpd/ 11 Aug 2018