Struckmonger
Cadet
- Joined
- Jan 1, 2018
- Messages
- 8
I'm trying to make a startup script for my Flood UI for rtorrent, but I am new to rc.d scripts. The command I created in
TLDR: Why doesn't
Here's the full script:
flood_start()
seems to work well for daemonizing flood if executed through shell, but for some reason this command won't execute at all (flood won't start, nothing occurs) if ran by calling service flood start
. The stop command does work fine though. The script is located at /usr/local/etc/rc.d/flood
.TLDR: Why doesn't
/usr/local/bin/sudo /usr/local/bin/screen -d -m -fa -S flood /usr/local/bin/npm start --prefix /srv/torrent/flood
work at all when called through rc.d?Here's the full script:
Code:
#!/bin/sh # # PROVIDE: flood # REQUIRE: NETWORK # KEYWORD: shutdown . /etc/rc.subr name="flood" rcvar=flood_enable start_cmd="${name}_start" stop_cmd="${name}_stop" load_rc_config $name : ${flood_enable:=no} : ${pid:=$(/usr/local/bin/pidof node)} flood_start() { /usr/local/bin/sudo /usr/local/bin/screen -d -m -fa -S flood /usr/local/bin/npm start --prefix /srv/torrent/flood } flood_stop() { echo Killing $pid kill $pid } run_rc_command "$1"
Last edited: