Check to see if my system has systemd available
For anyone wondering if your system has systemd, not if it was booted by systemd, these are the easiest commands I could come up with. I'm using this to test if my custom embedded Linux board successfully got systemd onto it from Buildroot:
# best: check the systemd-run version
systemd-run --version
# or: look for any "systemd" files or folders on your computer
find / | grep -i systemd | sort -V
# or: look for "systemd" files in /usr/bin
find /usr/bin | grep -i systemd | sort -V
For my board, I get the following output:
1st command:
# systemd-run --version
systemd 244 (244)
-PAM -AUDIT -SELINUX -IMA -APPARMOR -SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS -ACL -XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid
My systemd.mk makefile in Buildroot shows SYSTEMD_VERSION = 244.3, so this makes sense.
2nd command:
It's too long for me to care to copy/paste it all, but it shows entries in /usr/lib/systemd, /usr/bin/systemd*, etc.
3rd command:
# find /usr/bin | grep -i systemd | sort -V
/usr/bin/systemd-analyze
/usr/bin/systemd-ask-password
/usr/bin/systemd-cat
/usr/bin/systemd-cgls
/usr/bin/systemd-cgtop
/usr/bin/systemd-delta
/usr/bin/systemd-detect-virt
/usr/bin/systemd-escape
/usr/bin/systemd-id128
/usr/bin/systemd-machine-id-setup
/usr/bin/systemd-mount
/usr/bin/systemd-notify
/usr/bin/systemd-nspawn
/usr/bin/systemd-path
/usr/bin/systemd-run
/usr/bin/systemd-socket-activate
/usr/bin/systemd-stdio-bridge
/usr/bin/systemd-tty-ask-password-agent
/usr/bin/systemd-umount
This is the list from which I found the systemd-run executable. I simply guessed that running systemd-run --version might work, and sure enough, it did!
See also
- Super User: How to know if I am using systemd on Linux?
- Convenient way to check if system is using systemd or sysvinit in BASH?