/srv/irclogs.ubuntu.com/2011/07/20/#upstart.txt

robinbowesHi guys15:10
robinbowesIs there a canonical way to detect if a system is running upstart or inittab?15:10
robinbowesI'm updating an rpm to work on CentOS 6 and I want it to also work on CentOS 5.x15:11
JanCrobinbowes: do you want to know whether upstart is running *now*, or whether it's installed as "init"?17:30
robinbowesI want to know whether to cat >> /etc/iniitab or cat > /etc/init/some_service.conf17:31
JanCeh17:31
robinbowesTo install the service17:31
JanCI think looking what's installed should be good then17:31
robinbowesWith SysVinit, it requires adding linwes to /etc/inittab17:31
robinbowesYeah17:32
robinbowesWhat I went with was:17:32
robinbowesrpm --queryformat='%%{name}' -qf /sbin/init | grep -q upstart17:32
robinbowesif [ $? -eq 0 ]17:32
robinbowes...17:32
JanCI suppose that's somewhat like using 'dpkg -S /sbin/init' in Debian/Ubuntu?17:33
robinbowesOF course, I'll also need to add support for systems :/17:33
robinbowesIt means "which package owns the file /sbin/init"17:33
robinbowes--queryformat='%{name}' ensures a consistent output format17:34
robinbowesThe double %% is required since %{...} is expanded in rpm spec files17:34
JanCyou can try to connect to upstart using dbus and such, but that's probably more trouble than you want...17:34
=== sadmac_food is now known as sadmac

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!