[newbies] SysV

mistor-klimaks yandex.ru
21 21:50:56 MSK 2022


.
  ,       
 .
   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




devel-newbies