Skip to content

Commit

Permalink
atftpd: update init script to use procd
Browse files Browse the repository at this point in the history
* update init script to use procd

Signed-off-by: Mohd Husaam Mehdi <[email protected]>
  • Loading branch information
mhusaam authored and feckert committed Nov 28, 2024
1 parent 3d05b2c commit 6afd740
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions net/atftp/files/atftpd.init
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
# Copyright (C) 2020 OpenWrt.org

START=95
PIDFILE=/tmp/run/atftpd.pid

start() {
USE_PROCD=1
BIN=atftpd

start_service() {
local enable
local srv
local port
Expand All @@ -17,9 +19,8 @@ start() {
config_get srv service path "/srv/tftp"
config_get port service port 69

atftpd --pidfile $PIDFILE --user root.root --port $port --daemon $srv
}

stop() {
kill $(cat $PIDFILE)
procd_open_instance
procd_set_param command $BIN "--no-fork" "--daemon" "--user" "root.root" "--port" "$port" "$srv"
procd_set_param respawn
procd_close_instance
}

0 comments on commit 6afd740

Please sign in to comment.