#!/bin/sh ########################################################################### # /usr/bin/service # # A convenient wrapper for the /etc/init.d init scripts. # # This script is a modified version of the /sbin/service utility found on # Red Hat/Fedora systems (licensed GPLv2+). # # Copyright (C) 2006 Red Hat, Inc. All rights reserved. # Copyright (C) 2008 Canonical Ltd. # * August 2008 - Dustin Kirkland <kirkland@canonical.com> # Copyright (C) 2013 Michael Stapelberg <stapelberg@debian.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # On Debian GNU/Linux systems, the complete text of the GNU General # Public License can be found in `/usr/share/common-licenses/GPL-2'. ########################################################################### is_ignored_file() { case "$1" in skeleton | README | *.dpkg-dist | *.dpkg-old | rc | rcS | single | reboot | bootclean.sh) return 0 ;; esac return 1 } VERSION="`basename $0` ver. 1.51" USAGE="Usage: `basename $0` < option > | --status-all | \ [ service_name [ command | --full-restart ] ]" SERVICE= ACTION= SERVICEDIR="/etc/init.d" OPTIONS= is_systemd= if [ $# -eq 0 ]; then echo "${USAGE}" >&2 exit 1 fi if [ -d /run/systemd/system ]; then is_systemd=1 fi cd / while [ $# -gt 0 ]; do case "${1}" in --help | -h | --h* ) echo "${USAGE}" >&2 exit 0 ;; --version | -V ) echo "${VERSION}" >&2 exit 0 ;; *) if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then cd ${SERVICEDIR} for SERVICE in * ; do case "${SERVICE}" in functions | halt | killall | single| linuxconf| kudzu) ;; *) if ! is_ignored_file "${SERVICE}" \ && [ -x "${SERVICEDIR}/${SERVICE}" ]; then out=$(env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" status 2>&1) retval=$? if echo "$out" | egrep -iq "usage:"; then #printf " %s %-60s %s\n" "[?]" "$SERVICE:" "unknown" 1>&2 echo " [ ? ] $SERVICE" 1>&2 continue else if [ "$retval" = "0" -a -n "$out" ]; then #printf " %s %-60s %s\n" "[+]" "$SERVICE:" "running" echo " [ + ] $SERVICE" continue else #printf " %s %-60s %s\n" "[-]" "$SERVICE:" "NOT running" echo " [ - ] $SERVICE" continue fi fi #env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" status fi ;; esac done exit 0 elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then SERVICE="${1}" # On systems using systemd, we just perform a normal restart: # A restart with systemd is already a full restart. if [ -n "$is_systemd" ]; then ACTION="restart" else if [ -x "${SERVICEDIR}/${SERVICE}" ]; then env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" stop env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" start exit $? fi fi elif [ -z "${SERVICE}" ]; then SERVICE="${1}" elif [ -z "${ACTION}" ]; then ACTION="${1}" else OPTIONS="${OPTIONS} ${1}" fi shift ;; esac done run_via_sysvinit() { # Otherwise, use the traditional sysvinit if [ -x "${SERVICEDIR}/${SERVICE}" ]; then exec env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" ${ACTION} ${OPTIONS} else echo "${SERVICE}: unrecognized service" >&2 exit 1 fi } update_openrc_started_symlinks() { # maintain the symlinks of /run/openrc/started so that # rc-status works with the service command as well if [ -d /run/openrc/started ] ; then case "${ACTION}" in start) if [ ! -h /run/openrc/started/$SERVICE ] ; then ln -s $SERVICEDIR/$SERVICE /run/openrc/started/$SERVICE || true fi ;; stop) rm /run/openrc/started/$SERVICE || true ;; esac fi } # When this machine is running systemd, standard service calls are turned into # systemctl calls. if [ -n "$is_systemd" ] then UNIT="${SERVICE%.sh}.service" # avoid deadlocks during bootup and shutdown from units/hooks # which call "invoke-rc.d service reload" and similar, since # the synchronous wait plus systemd's normal behaviour of # transactionally processing all dependencies first easily # causes dependency loops if ! systemctl --quiet is-active multi-user.target; then sctl_args="--job-mode=ignore-dependencies" fi case "${ACTION}" in restart|status|try-restart) exec systemctl $sctl_args ${ACTION} ${UNIT} ;; start|stop) # Follow the principle of least surprise for SysV people: # When running "service foo stop" and foo happens to be a service that # has one or more .socket files, we also stop the .socket units. # Users who need more control will use systemctl directly. for unit in $(systemctl list-unit-files --full --type=socket 2>/dev/null | sed -ne 's/\.socket\s*[a-z]*\s*$/.socket/p'); do if [ "$(systemctl -p Triggers show $unit)" = "Triggers=${UNIT}" ]; then systemctl $sctl_args ${ACTION} $unit fi done exec systemctl $sctl_args ${ACTION} ${UNIT} ;; reload) _canreload="$(systemctl -p CanReload show ${UNIT} 2>/dev/null)" if [ "$_canreload" = "CanReload=no" ]; then # The reload action falls back to the sysv init script just in case # the systemd service file does not (yet) support reload for a # specific service. run_via_sysvinit else exec systemctl $sctl_args reload "${UNIT}" fi ;; force-stop) exec systemctl --signal=KILL kill "${UNIT}" ;; force-reload) _canreload="$(systemctl -p CanReload show ${UNIT} 2>/dev/null)" if [ "$_canreload" = "CanReload=no" ]; then exec systemctl $sctl_args restart "${UNIT}" else exec systemctl $sctl_args reload "${UNIT}" fi ;; *) # We try to run non-standard actions by running # the init script directly. run_via_sysvinit ;; esac fi update_openrc_started_symlinks run_via_sysvinit
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
ModemManager | File | 1.37 MB | 0755 |
|
NetworkManager | File | 2.54 MB | 0755 |
|
a2disconf | File | 15.89 KB | 0755 |
|
a2dismod | File | 15.89 KB | 0755 |
|
a2dissite | File | 15.89 KB | 0755 |
|
a2enconf | File | 15.89 KB | 0755 |
|
a2enmod | File | 15.89 KB | 0755 |
|
a2ensite | File | 15.89 KB | 0755 |
|
a2query | File | 9.64 KB | 0755 |
|
aa-remove-unknown | File | 2.85 KB | 0755 |
|
aa-status | File | 8.41 KB | 0755 |
|
accessdb | File | 10.23 KB | 0755 |
|
acpid | File | 50.84 KB | 0755 |
|
add-shell | File | 860 B | 0755 |
|
addgnupghome | File | 3.01 KB | 0755 |
|
addgroup | File | 36.45 KB | 0755 |
|
adduser | File | 36.45 KB | 0755 |
|
apache2 | File | 659.69 KB | 0755 |
|
apache2ctl | File | 7.06 KB | 0755 |
|
apachectl | File | 7.06 KB | 0755 |
|
apparmor_status | File | 8.41 KB | 0755 |
|
applygnupgdefaults | File | 2.17 KB | 0755 |
|
arp | File | 61.3 KB | 0755 |
|
arpd | File | 54.03 KB | 0755 |
|
aspell-autobuildhash | File | 13.22 KB | 0755 |
|
atd | File | 26.01 KB | 0755 |
|
bcache-super-show | File | 13.99 KB | 0755 |
|
biosdecode | File | 18.87 KB | 0755 |
|
chat | File | 30.01 KB | 0755 |
|
check_forensic | File | 952 B | 0755 |
|
chgpasswd | File | 57.83 KB | 0755 |
|
chmem | File | 42.08 KB | 0755 |
|
chpasswd | File | 53.86 KB | 0755 |
|
chroot | File | 38.18 KB | 0755 |
|
cpgr | File | 55.96 KB | 0755 |
|
cppw | File | 55.96 KB | 0755 |
|
cron | File | 46.3 KB | 0755 |
|
cryptdisks_start | File | 1.11 KB | 0755 |
|
cryptdisks_stop | File | 1.16 KB | 0755 |
|
danted | File | 858.54 KB | 0755 |
|
dbconfig-generate-include | File | 12.37 KB | 0755 |
|
dbconfig-load-include | File | 5.57 KB | 0755 |
|
delgroup | File | 16.11 KB | 0755 |
|
deluser | File | 16.11 KB | 0755 |
|
dmidecode | File | 106.54 KB | 0755 |
|
dnsmasq | File | 379.6 KB | 0755 |
|
dpkg-preconfigure | File | 3.58 KB | 0755 |
|
dpkg-reconfigure | File | 4.34 KB | 0755 |
|
e2freefrag | File | 14.07 KB | 0755 |
|
e4crypt | File | 22.07 KB | 0755 |
|
e4defrag | File | 25.99 KB | 0755 |
|
escapesrc | File | 22.16 KB | 0755 |
|
faillock | File | 13.99 KB | 0755 |
|
fanatic | File | 35.21 KB | 0755 |
|
fanctl | File | 41.98 KB | 0755 |
|
fdformat | File | 30.08 KB | 0755 |
|
filefrag | File | 14.02 KB | 0755 |
|
gconf-schemas | File | 4.45 KB | 0755 |
|
genccode | File | 10.36 KB | 0755 |
|
gencmn | File | 10.44 KB | 0755 |
|
genl | File | 58.05 KB | 0755 |
|
gennorm2 | File | 54.59 KB | 0755 |
|
gensprep | File | 18.5 KB | 0755 |
|
groupadd | File | 61.92 KB | 0755 |
|
groupdel | File | 70.37 KB | 0755 |
|
groupmems | File | 57.87 KB | 0755 |
|
groupmod | File | 68.18 KB | 0755 |
|
grpck | File | 53.8 KB | 0755 |
|
grpconv | File | 49.68 KB | 0755 |
|
grpunconv | File | 49.68 KB | 0755 |
|
grub-install | File | 1003.51 KB | 0755 |
|
grub-macbless | File | 780.84 KB | 0755 |
|
grub-mkconfig | File | 8.03 KB | 0755 |
|
grub-mkdevicemap | File | 207.62 KB | 0755 |
|
grub-probe | File | 793.09 KB | 0755 |
|
grub-reboot | File | 4.73 KB | 0755 |
|
grub-set-default | File | 832 B | 0755 |
|
grub-set-default-legacy-ec2 | File | 3.13 KB | 0755 |
|
grub-set-default.real | File | 3.47 KB | 0755 |
|
hddtemp | File | 38.68 KB | 0755 |
|
httxt2dbm | File | 9.99 KB | 0755 |
|
iconvconfig | File | 30.25 KB | 0755 |
|
icupkg | File | 18.77 KB | 0755 |
|
init.lxc | File | 38.5 KB | 0755 |
|
init.lxc.static | File | 1005.91 KB | 0755 |
|
invoke-rc.d | File | 15.66 KB | 0755 |
|
ip6tables-apply | File | 6.85 KB | 0755 |
|
iptables-apply | File | 6.85 KB | 0755 |
|
irqbalance | File | 62.68 KB | 0755 |
|
irqbalance-ui | File | 34.06 KB | 0755 |
|
isadump | File | 13.99 KB | 0755 |
|
isaset | File | 9.99 KB | 0755 |
|
iscsi-iname | File | 9.99 KB | 0755 |
|
iscsi_discovery | File | 5.16 KB | 0755 |
|
iscsid | File | 398.15 KB | 0755 |
|
iscsistart | File | 358.13 KB | 0755 |
|
ispell-autobuildhash | File | 15.39 KB | 0755 |
|
ldattach | File | 30.08 KB | 0755 |
|
locale-gen | File | 4.3 KB | 0755 |
|
logrotate | File | 74.09 KB | 0755 |
|
luksformat | File | 3.32 KB | 0755 |
|
make-bcache | File | 18.07 KB | 0755 |
|
make-ssl-cert | File | 3.78 KB | 0755 |
|
mkinitramfs | File | 10.89 KB | 0755 |
|
mklost+found | File | 9.99 KB | 0755 |
|
mysqld | File | 23.16 MB | 0755 |
|
netfilter-persistent | File | 1.05 KB | 0755 |
|
netplan | File | 798 B | 0755 |
|
newusers | File | 82.39 KB | 0755 |
|
nfnl_osf | File | 13.99 KB | 0755 |
|
nologin | File | 5.99 KB | 0755 |
|
openvpn | File | 750.27 KB | 0755 |
|
overlayroot-chroot | File | 2.45 KB | 0755 |
|
ownership | File | 10.13 KB | 0755 |
|
pam-auth-update | File | 19.38 KB | 0755 |
|
pam_getenv | File | 2.82 KB | 0755 |
|
pam_timestamp_check | File | 9.99 KB | 0755 |
|
paperconfig | File | 4.07 KB | 0755 |
|
php7-fpm | File | 37.24 MB | 0755 |
|
phpdismod | File | 7.11 KB | 0755 |
|
phpenmod | File | 7.11 KB | 0755 |
|
phpquery | File | 6.24 KB | 0755 |
|
pma-configure | File | 299 B | 0755 |
|
pma-secure | File | 157 B | 0755 |
|
popcon-largest-unused | File | 543 B | 0755 |
|
popularity-contest | File | 4.92 KB | 0755 |
|
pppd | File | 369.73 KB | 4754 |
|
pppdump | File | 18.1 KB | 0755 |
|
pppoe-discovery | File | 18 KB | 0755 |
|
pppstats | File | 13.99 KB | 0755 |
|
pptp | File | 62.98 KB | 0755 |
|
pptpsetup | File | 6.46 KB | 0755 |
|
pwck | File | 49.8 KB | 0755 |
|
pwconv | File | 45.7 KB | 0755 |
|
pwunconv | File | 45.68 KB | 0755 |
|
readprofile | File | 18.11 KB | 0755 |
|
recvtty | File | 3.4 MB | 0755 |
|
remove-default-ispell | File | 2.86 KB | 0755 |
|
remove-default-wordlist | File | 2.86 KB | 0755 |
|
remove-shell | File | 904 B | 0755 |
|
rmt | File | 58.39 KB | 0755 |
|
rmt-tar | File | 58.39 KB | 0755 |
|
rsyslogd | File | 668.54 KB | 0755 |
|
rtcwake | File | 42.08 KB | 0755 |
|
rtkitctl | File | 10.06 KB | 0755 |
|
runc | File | 8.37 MB | 0755 |
|
sd-helper | File | 3.26 MB | 0755 |
|
seccompagent | File | 2.18 MB | 0755 |
|
select-default-ispell | File | 3.23 KB | 0755 |
|
select-default-wordlist | File | 3.21 KB | 0755 |
|
sensors-detect | File | 204.66 KB | 0755 |
|
service | File | 9.04 KB | 0755 |
|
setvesablank | File | 14.07 KB | 0755 |
|
split-logfile | File | 2.36 KB | 0755 |
|
sshd | File | 772.41 KB | 0755 |
|
tarcat | File | 936 B | 0755 |
|
tcpdump | File | 999.6 KB | 0755 |
|
tzconfig | File | 106 B | 0755 |
|
ufw | File | 4.82 KB | 0755 |
|
update-ca-certificates | File | 5.27 KB | 0755 |
|
update-default-aspell | File | 1 KB | 0755 |
|
update-default-ispell | File | 9.68 KB | 0755 |
|
update-default-wordlist | File | 7.5 KB | 0755 |
|
update-dictcommon-aspell | File | 1 KB | 0755 |
|
update-dictcommon-hunspell | File | 782 B | 0755 |
|
update-fonts-alias | File | 5.71 KB | 0755 |
|
update-fonts-dir | File | 3.98 KB | 0755 |
|
update-fonts-scale | File | 6.1 KB | 0755 |
|
update-grub | File | 64 B | 0755 |
|
update-grub-legacy-ec2 | File | 43.96 KB | 0755 |
|
update-grub2 | File | 64 B | 0755 |
|
update-gsfontmap | File | 450 B | 0755 |
|
update-icon-caches | File | 596 B | 0755 |
|
update-info-dir | File | 1.66 KB | 0755 |
|
update-initramfs | File | 8.04 KB | 0755 |
|
update-locale | File | 2.99 KB | 0755 |
|
update-mime | File | 8.84 KB | 0755 |
|
update-passwd | File | 30.41 KB | 0755 |
|
update-pciids | File | 2.84 KB | 0755 |
|
update-rc.d | File | 16.12 KB | 0755 |
|
update-secureboot-policy | File | 7.43 KB | 0755 |
|
update-usbids | File | 1.05 KB | 0755 |
|
usb_modeswitch | File | 59.51 KB | 0755 |
|
usb_modeswitch_dispatcher | File | 46.16 KB | 0755 |
|
usbmuxd | File | 70.38 KB | 0755 |
|
useradd | File | 123.28 KB | 0755 |
|
userdel | File | 82.48 KB | 0755 |
|
usermod | File | 123.06 KB | 0755 |
|
uuidd | File | 34.16 KB | 0755 |
|
validlocale | File | 1.73 KB | 0755 |
|
vcstime | File | 9.99 KB | 0755 |
|
vigr | File | 60.18 KB | 0755 |
|
vipw | File | 60.18 KB | 0755 |
|
visudo | File | 208.8 KB | 0755 |
|
vpddecode | File | 14.27 KB | 0755 |
|
xfce4-kiosk-query | File | 9.99 KB | 0755 |
|
xfce4-pm-helper | File | 9.99 KB | 0755 |
|
xfpm-power-backlight-helper | File | 13.99 KB | 0755 |
|
xfs_admin | File | 1.35 KB | 0755 |
|
xfs_bmap | File | 638 B | 0755 |
|
xfs_copy | File | 394.31 KB | 0755 |
|
xfs_db | File | 667.63 KB | 0755 |
|
xfs_estimate | File | 10.01 KB | 0755 |
|
xfs_freeze | File | 767 B | 0755 |
|
xfs_fsr | File | 30.02 KB | 0755 |
|
xfs_growfs | File | 382.27 KB | 0755 |
|
xfs_info | File | 472 B | 0755 |
|
xfs_io | File | 130.93 KB | 0755 |
|
xfs_logprint | File | 414.27 KB | 0755 |
|
xfs_mdrestore | File | 370.28 KB | 0755 |
|
xfs_metadump | File | 747 B | 0755 |
|
xfs_mkfile | File | 1007 B | 0755 |
|
xfs_ncheck | File | 650 B | 0755 |
|
xfs_quota | File | 86.01 KB | 0755 |
|
xfs_rtcp | File | 13.99 KB | 0755 |
|
zerofree | File | 9.99 KB | 0755 |
|
zic | File | 54.14 KB | 0755 |
|