ScriptDesign
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
*** Cent OS の /etc/init.d/yum の内容 [#h1dd1c75]
[root@spirit init.d]# cat yum
#!/bin/bash
#
# yum This shell script enables the automatic ...
#
# Author: Seth Vidal <skvidal@phy.duke.edu>
#
# chkconfig: - 50 01
#
# description: Enable daily run of yum, a program updat...
# processname: yum
# config: /etc/yum.conf
#
# source function library
. /etc/rc.d/init.d/functions
lockfile=/var/lock/subsys/yum
RETVAL=0
start() {
echo -n $"Enabling nightly yum update: "
touch "$lockfile" && success || failure
RETVAL=$?
echo
}
stop() {
echo -n $"Disabling nightly yum update: "
rm -f "$lockfile" && success || failure
RETVAL=$?
echo
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|force-reload)
restart
;;
reload)
;;
condrestart)
[ -f "$lockfile" ] && restart
;;
status)
if [ -f $lockfile ]; then
echo $"Nightly yum update is enabled."
RETVAL=0
else
echo $"Nightly yum update is disabled."
RETVAL=3
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|relo...
exit 1
esac
exit $RETVAL
*** 他のサイトからの引用 [#hb73270a]
#!/bin/bash
# chkconfig: 345 80 20
# description: Clamd DAEMON
. /etc/init.d/functions
prog="/usr/sbin/clamd"
prog_base="$(basename ${prog})"
prog_config_file="/etc/clamd.conf"
RETVAL=0
# See how we were called.
case "$1" in
start)
action $"Starting ${prog_base}:" ${prog} -c ${prog_c...
RETVAL=$?
echo
;;
stop)
echo $"Shutting down ${prog_base}"
killproc ${prog_base}
RETVAL=$?
echo
;;
status)
status $"${prog_base}"
RETVAL=$?
echo
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
reload)
pid=`pidofproc ${prog_base}`
kill -USR2 ${pid}
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload}"
exit 1
esac
exit $RETVAL
終了行:
*** Cent OS の /etc/init.d/yum の内容 [#h1dd1c75]
[root@spirit init.d]# cat yum
#!/bin/bash
#
# yum This shell script enables the automatic ...
#
# Author: Seth Vidal <skvidal@phy.duke.edu>
#
# chkconfig: - 50 01
#
# description: Enable daily run of yum, a program updat...
# processname: yum
# config: /etc/yum.conf
#
# source function library
. /etc/rc.d/init.d/functions
lockfile=/var/lock/subsys/yum
RETVAL=0
start() {
echo -n $"Enabling nightly yum update: "
touch "$lockfile" && success || failure
RETVAL=$?
echo
}
stop() {
echo -n $"Disabling nightly yum update: "
rm -f "$lockfile" && success || failure
RETVAL=$?
echo
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|force-reload)
restart
;;
reload)
;;
condrestart)
[ -f "$lockfile" ] && restart
;;
status)
if [ -f $lockfile ]; then
echo $"Nightly yum update is enabled."
RETVAL=0
else
echo $"Nightly yum update is disabled."
RETVAL=3
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|relo...
exit 1
esac
exit $RETVAL
*** 他のサイトからの引用 [#hb73270a]
#!/bin/bash
# chkconfig: 345 80 20
# description: Clamd DAEMON
. /etc/init.d/functions
prog="/usr/sbin/clamd"
prog_base="$(basename ${prog})"
prog_config_file="/etc/clamd.conf"
RETVAL=0
# See how we were called.
case "$1" in
start)
action $"Starting ${prog_base}:" ${prog} -c ${prog_c...
RETVAL=$?
echo
;;
stop)
echo $"Shutting down ${prog_base}"
killproc ${prog_base}
RETVAL=$?
echo
;;
status)
status $"${prog_base}"
RETVAL=$?
echo
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
reload)
pid=`pidofproc ${prog_base}`
kill -USR2 ${pid}
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload}"
exit 1
esac
exit $RETVAL
ページ名: