Comments (7)
ArchLinux: using systemd (since 2012.10.06)
CentOS6.4 ami-52009e3b: using upstart
CentOS7 ami-96a818fe: using systemd
Debian 6 ami-80e915e9: using sysv-init
Debian 7.5 ami-2c886c44: using sysv-init
Debian 7.6 GCE container-vm: using sysv-init
RHEL 6.5 ami-8d756fe4: using upstart
SLES 11 ami-e8084981: using sysv-init
Ubuntu 10.04 ami-6b350a02: using upstart
Ubuntu 12.04 ami-b08b6cd8: using upstart
Ubuntu 14.04 ami-a427efcc: using upstart
Ubuntu 14.10 and younger: using systemd
AWS linux 2014.3.2 ami-7c807d14: using upstart
Fedora 19 ami-f525389c: using systemd
Fedora 20 ami-21362b48: using systemd
from python-parental-control.
You can tell upstart from:
[[ `/sbin/init --version` =~ upstart ]] && echo yes || echo no
You can tell systemd from:
[[ `systemctl` =~ -\.mount ]] && echo yes || echo no
You can tell sys-v init from:
[[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]] && echo yes
from python-parental-control.
if [[ /sbin/init --version
=~ upstart ]]; then echo using upstart;
elif [[ systemctl
=~ -.mount ]]; then echo using systemd;
elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then echo using sysv-init;
else echo cannot tell; fi
from python-parental-control.
#!/bin/sh
if [ command -v systemctl >/dev/null ]
then
systemctl service start
else
/etc/init.d/service start
fi
from python-parental-control.
$ ps -eaf|grep '[u]pstart'
$ ps -eaf|grep '[s]ystemd'
$ sudo init --version
$ sudo systemctl --version (unsure)
from python-parental-control.
strings /sbin/init | grep -q "/lib/systemd" && echo SYSTEMD
strings /sbin/init | grep -q "sysvinit" && echo SYSVINIT
strings /sbin/init | grep -q "upstart" && echo UPSTART
from python-parental-control.
/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
gnome-session-quit --power-off --force --no-prompt
from python-parental-control.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-parental-control.