updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / yum / yum-updatesd.init
blob069d487c0b0df183b54ada1411c500f0908355e8
1 #!/bin/bash
3 # yum This shell script enables the yum-updates daemon
5 # Author: Jeremy Katz <katzj@redhat.com>
6 # Adapted for ArchLinux by Chris Tusa <linisys@gmail.com>
8 # description: This is a daemon which periodically checks for updates \
9 # and can send notifications via mail, dbus or syslog.
11 # processname: yum-updatesd
12 # config: /etc/yum/yum-updatesd.conf
13 # pidfile: /var/run/yum-updatesd.pid
16 . /etc/rc.conf
17 . /etc/rc.d/functions
19 case "$1" in
20 start)
21 stat_busy "Starting yum-updatesd"
22 [ ! -f /var/run/daemons/yum-updatesd ] && nice +19 /usr/sbin/yum-updatesd
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 pgrep -of "yum-updatesd" > /var/run/yum-updatesd.pid
27 add_daemon yum-updatesd
28 stat_done
32 stop)
33 stat_busy "Stopping yum-updatesd"
34 [ -f /var/run/yum-updatesd.pid ] && kill `cat /var/run/yum-updatesd.pid`
35 if [ $? -gt 0 ]; then
36 stat_fail
37 else
38 rm_daemon yum-updatesd
39 stat_done
42 restart)
43 $0 stop
44 sleep 1
45 $0 start
48 echo "usage: $0 {start|stop|restart}"
49 esac
50 exit 0