From: Евгений <mistor-klimaks@yandex.ru>
To: devel-newbies@lists.altlinux.org
Subject: [newbies] Скрипт инициализации SysV
Date: Fri, 21 Jan 2022 21:50:56 +0300
Message-ID: <2ea599a6-05e3-3f67-6274-0849dc259120@yandex.ru> (raw)
Здравствуйте.
Написал скрипт инициализации, кто хорошо разбирается посмотрите верно ли
он написан.
Тестировал его на regular-icewm-sysv работает.
#!/bin/sh
#
# Initialization file for the radeon-profile daemon.
#
# chkconfig: - 90 10
# description: A system daemon for reading Radeon GPU clock speed and
voltage information.
# processname: radeon-profile-daemon
# pidfile: /var/run/radeon-profile-daemon.pid
#
### BEGIN INIT INFO
# Provides: radeon-profile-daemon
# Required-Start: $local_fs $syslog
# Required-Stop: $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Service for radeon-profile
# Description: ATI Radeon GPU Parameter Monitoring Service
### END INIT INFO
#
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/rc.d/init.d/functions
PIDFILE=/var/run/radeon-profile-daemon.pid
LOCKFILE=/var/lock/subsys/radeon-profile-daemon
RETVAL=0
start()
{
start_daemon --make-pidfile --pidfile "$PIDFILE" --lockfile
"$LOCKFILE" --expect-user root -- radeon-profile-daemon
RETVAL=$?
return $RETVAL
}
stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE"
--expect-user root -- radeon-profile-daemon
RETVAL=$?
return $RETVAL
}
restart()
{
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload|restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condreload|condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user root --
radeon-profile-daemon
RETVAL=$?
;;
*)
msg_usage "${0##*/}
{start|stop|reload|restart|condstop|condrestart|condreload|status}"
RETVAL=1
esac
exit $RETVAL
reply other threads:[~2022-01-21 18:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2ea599a6-05e3-3f67-6274-0849dc259120@yandex.ru \
--to=mistor-klimaks@yandex.ru \
--cc=devel-newbies@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
devel@ where you _can_ ask
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel-newbies/0 devel-newbies/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel-newbies devel-newbies/ http://lore.altlinux.org/devel-newbies \
devel-newbies@lists.altlinux.org devel-newbies@lists.altlinux.ru devel-newbies@lists.altlinux.com
public-inbox-index devel-newbies
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel-newbies
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git