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 committed Mar 29, 2024
1 parent 5aee095 commit 49c4564
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion net/atftp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=atftp
PKG_VERSION:=0.8.0
PKG_RELEASE:=2
PKG_RELEASE:=3

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
Expand Down
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 49c4564

Please sign in to comment.