Bkd doesn't write pid file when user isn't root

Don’t we need this:

martind@stormy:~/work/bk/bugfix/man/man1$ bk diffs 
===== bk-bkd.1 1.52 vs edited =====
--- 1.52/man/man1/bk-bkd.1	2016-04-27 11:24:56 -07:00
+++ edited/man/man1/bk-bkd.1	2025-01-24 09:38:58 -08:00
@@ -333,6 +333,8 @@
 		do	(
 			cd $dir || exit 1
 			F=\`basename $dir\`
+			touch $VAR/pid.$F
+			chown $user $VAR/pid.$F
 			CMD="bk bkd \-d $opts \-l$VAR/log.$F \-P$VAR/pid.$F"
 			su -c "$CMD" $user 2>> $VAR/errors
 			echo Started $CMD in $dir
martind@stormy:~/work/bk/bugfix/man/man1$ 

…?

I guess so. Doesn’t the logfile have the same problem?

So it does. (I noticed the pid file being missing because it caused a visible error when I tried to do a shutdown of the daemon as part of a cut-over to a different file system. I didn’t notice the log because I haven’t needed it.)

martind@stormy:~/work/bk/bugfix$ bk diffs man/man1/bk-bkd.1
===== man/man1/bk-bkd.1 1.52 vs edited =====
--- 1.52/man/man1/bk-bkd.1	2016-04-27 11:24:56 -07:00
+++ edited/man/man1/bk-bkd.1	2025-02-10 11:22:02 -08:00
@@ -333,6 +333,8 @@
 		do	(
 			cd $dir || exit 1
 			F=\`basename $dir\`
+			touch $VAR/log.$F $VAR/pid.$F
+			chown $user $VAR/log.$F $VAR/pid.$F
 			CMD="bk bkd \-d $opts \-l$VAR/log.$F \-P$VAR/pid.$F"
 			su -c "$CMD" $user 2>> $VAR/errors
 			echo Started $CMD in $dir
martind@stormy:~/work/bk/bugfix$