Linked Questions

91
votes
5answers
93k views

How to find out if a system uses SysV, Upstart or Systemd initsystem [duplicate]

Is there a simple way to find out which initsystem is being used e.g by a recent Debian wheezy or Fedora system? I'm aware that Fedora 21 uses systemd initsystem but that is because I read that and ...
41
votes
1answer
70k views

Convenient way to check if system is using systemd or sysvinit in BASH? [duplicate]

I am defining common bash files which I want to use across different distributions. I need a way to check if system is using systemd or sysvinit (/etc/init.d/). I need this so I run appropriate ...
2
votes
1answer
607 views

Can I tell if I'm running in systemd? [duplicate]

I have a Python service in systemd. I'd like to have it use the Python syslog module for logging if it's running in systemd vs. otherwise. Is there a reliable way to determine if I'm running in ...
1
vote
0answers
366 views

How to determine which init system is used? [duplicate]

Is there a way to determine which init system is being used in Linux? (such as sysvinit, upstart, systemd, etc.) I don't care if it can be programmatically determined, I just want to know how I can ...
0
votes
0answers
42 views

Bash script to identify which init system the system currently using [duplicate]

I have to create a script that will mount my /usr folder as aufs. I compressed it using squashfs. I've managed to install a working systemd init in ubuntu which I am currently using. Because the ...
65
votes
6answers
4k views

Resources for portable shell programming

What resources exist for portable shell programming? The ultimate answer is to test on all targeted platforms, but that's rarely practical. The POSIX / Single UNIX specification is a start, but it ...
5
votes
1answer
1k views

What does `init [2]` mean in the COMMAND column of ps?

Reading What do the brackets around processes mean? I understand that the executable name is printed. Linux ps man page: Sometimes the process args will be unavailable; when this happens, ps will ...
1
vote
2answers
809 views

How to determine a Linux distro is systemd or sysV init without installing or booting?

I noticed in somewhere that most of the Linux distro are based on Systemd instead of SysV init. So I just want to know without installing and booting. Is there any possible way to find distro based ...
0
votes
2answers
284 views

should I disable both systemd and sysvinit to disable a service from run level?

My application should run on systems which run on systemd and older platforms where systemd is not available. So I am registering my service into run level using both chkconfig and systemctl enable. ...
1
vote
0answers
59 views

Flavour of initrd

This Arch wiki page says: If you are using a systemd based initrd, you must pass: rd.luks.options=discard How do I query the initrd mini-shell to find out if I am running a systemd-based initrd?...
0
votes
1answer
30 views

How to make my sysvinit service work on as many distros as possible?

I am attempting to write a cross-platform sysvinit service that works on as many sysvinit systems as possible. Things I need: The process needs to daemonize (it does not automatically daemonize ...