Browse Source

Merge pull request #1981 from philenotfound/master

at: update init script to use procd
Ted Hess 9 years ago
parent
commit
fe4121b49f
2 changed files with 11 additions and 8 deletions
  1. 1
    1
      utils/at/Makefile
  2. 10
    7
      utils/at/files/atd.init

+ 1
- 1
utils/at/Makefile View File

9
 
9
 
10
 PKG_NAME:=at
10
 PKG_NAME:=at
11
 PKG_VERSION:=3.1.16
11
 PKG_VERSION:=3.1.16
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13
 
13
 
14
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
14
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
15
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/a/at
15
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/a/at

+ 10
- 7
utils/at/files/atd.init View File

1
 #!/bin/sh /etc/rc.common
1
 #!/bin/sh /etc/rc.common
2
-# Copyright (C) 2011 OpenWrt.org
2
+# Copyright (C) 2015 OpenWrt.org
3
 
3
 
4
 START=50
4
 START=50
5
 
5
 
6
-SERVICE_USE_PID=1
6
+USE_PROCD=1
7
 
7
 
8
-start() {
8
+start_service() {
9
 	[ -d /var/spool/cron/atjobs ] || {
9
 	[ -d /var/spool/cron/atjobs ] || {
10
 		mkdir -m 0755 -p /var/spool/cron/atjobs
10
 		mkdir -m 0755 -p /var/spool/cron/atjobs
11
 		touch /var/spool/cron/atjobs/.SEQ
11
 		touch /var/spool/cron/atjobs/.SEQ
15
 		mkdir -m 0755 -p /var/spool/cron/atspool
15
 		mkdir -m 0755 -p /var/spool/cron/atspool
16
 		chown -R nobody:nogroup /var/spool/cron/atspool
16
 		chown -R nobody:nogroup /var/spool/cron/atspool
17
 	}
17
 	}
18
-	service_start /usr/sbin/atd
19
-}
18
+	procd_open_instance
19
+
20
+	procd_set_param command /usr/sbin/atd -f
21
+	procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
22
+	procd_set_param stdout 1 # forward stdout of the command to logd
23
+	procd_set_param stderr 1 # same for stderr
20
 
24
 
21
-stop() {
22
-	service_stop /usr/sbin/atd
25
+	procd_close_instance
23
 }
26
 }