If I ask daemon to write a pidfile, it does not run the app. How do I make it run the app and write a pidfile, as I expect? Sort is just a stand-in for a more complex app and is used to demonstrate my issue with daemon.
Code:
root@jenkins:~ # freebsd-version
13.4-RELEASE-p1
root@jenkins:~ # echo Contents > contents.txt
root@jenkins:~ # sort -o sortout.txt contents.txt
root@jenkins:~ # cat sortout.txt
Contents
root@jenkins:~ # rm sortout.txt
root@jenkins:~ # daemon sort -o sortout.txt contents.txt
root@jenkins:~ # cat sortout.txt
Contents
root@jenkins:~ # rm sortout.txt
root@jenkins:~ # daemon -p sort.pid sort -o sortout.txt contents.txt
root@jenkins:~ # cat sortout.txt
cat: sortout.txt: No such file or directory