Reputation
1,048
Next privilege 2,000 Rep.
Edit questions and answers
Badges
3 13 26
Impact
~95k people reached

  • 0 posts edited
  • 0 helpful flags
  • 36 votes cast
Jul
13
awarded  Famous Question
Jul
7
awarded  Good Question
Jun
19
awarded  Yearling
Feb
4
awarded  Notable Question
Jan
15
awarded  Popular Question
Jan
15
awarded  Notable Question
Jan
12
awarded  Famous Question
Nov
6
awarded  Famous Question
Sep
17
awarded  Nice Question
Aug
29
awarded  Nice Question
Aug
19
awarded  Popular Question
Aug
19
awarded  Notable Question
Jul
2
awarded  Curious
Jun
19
awarded  Yearling
May
13
awarded  Nice Question
Feb
25
awarded  Notable Question
Feb
11
awarded  Notable Question
Feb
3
awarded  Critic
Feb
2
awarded  Nice Question
Nov
24
comment Detect init system using the shell
@naxa - Short answer, no. Long answer, you can get pretty far with ps -p 1 -o command (prints the path to the current init). On Arch Linux and Fedora (IIRC), it's a symlink to the systemd binary (probably same on all systemd systems). On upstart, init --help will print usage information, and on my box, upstart is mentioned where it says who to email. On FreeBSD (sysV), this will return an error. There may be similar clues on other systems, but since asking this question, I've decided to just create them for all platforms and make separate packages for each one.