Linked Questions
15 questions linked to/from Detect init system using the shell
107
votes
5
answers
128k
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 ...
64
votes
1
answer
103k
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
1
answer
2k
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
0
answers
542
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 ...
76
votes
6
answers
6k
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 ...
24
votes
5
answers
4k
views
How can I determine, within a shell script, whether it is being called by systemd or not?
We have a shell script that -- for various reasons -- wraps a vendor's application. We have system administrators and application owners who have mixed levels of familiarity with systemd. As a result, ...
2
votes
2
answers
5k
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 ...
5
votes
1
answer
2k
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 ...
0
votes
1
answer
3k
views
ps axf shows "/sbin/init splash" for PID1
I want to reformulate a very interesting Q by Thelostcause ("Splash in PID =1"):
How does and how can "/sbin/init splash" show up in the ps command?
I also ask: aren't we (we who are running a "...
1
vote
1
answer
1k
views
How do I correctly check, if the system uses systemd?
On my debian 10 server pidof systemd gives no result, although there are pids:
# pgrep systemd -la
1 /sbin/init
256 /lib/systemd/systemd-journald
275 /lib/systemd/systemd-udevd
282 /lib/systemd/...
2
votes
1
answer
2k
views
How to disable autologin in UART console
We use card with embedded Linux: 4.1.22-ltsi , "Debian GNU/Linux 9 (stretch)".
On Uart console, after boot process, it automatically does login and shows prompt
root@linaro-developer:
root@...
0
votes
1
answer
808
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 ...
1
vote
2
answers
809
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
1
answer
396
views
Check whether linux is utilizing service or systemctl with a shell script
friends!
I need a mechanism to verify if the linux virtual private server is utilizing systemctl or service.
The systemd application is installed on all of them.
Current Code.
if pgrep systemd-journal;...
1
vote
0
answers
104
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?
...