robinbowes | Hi guys | 15:10 |
---|---|---|
robinbowes | Is there a canonical way to detect if a system is running upstart or inittab? | 15:10 |
robinbowes | I'm updating an rpm to work on CentOS 6 and I want it to also work on CentOS 5.x | 15:11 |
JanC | robinbowes: do you want to know whether upstart is running *now*, or whether it's installed as "init"? | 17:30 |
robinbowes | I want to know whether to cat >> /etc/iniitab or cat > /etc/init/some_service.conf | 17:31 |
JanC | eh | 17:31 |
robinbowes | To install the service | 17:31 |
JanC | I think looking what's installed should be good then | 17:31 |
robinbowes | With SysVinit, it requires adding linwes to /etc/inittab | 17:31 |
robinbowes | Yeah | 17:32 |
robinbowes | What I went with was: | 17:32 |
robinbowes | rpm --queryformat='%%{name}' -qf /sbin/init | grep -q upstart | 17:32 |
robinbowes | if [ $? -eq 0 ] | 17:32 |
robinbowes | ... | 17:32 |
JanC | I suppose that's somewhat like using 'dpkg -S /sbin/init' in Debian/Ubuntu? | 17:33 |
robinbowes | OF course, I'll also need to add support for systems :/ | 17:33 |
robinbowes | It means "which package owns the file /sbin/init" | 17:33 |
robinbowes | --queryformat='%{name}' ensures a consistent output format | 17:34 |
robinbowes | The double %% is required since %{...} is expanded in rpm spec files | 17:34 |
JanC | you 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!