Hello.<br><br>I've been trying to get gpg-agent running under supervision using<br>FreeBSD's native daemon(8) [1]<br><br>The description for the utility states the following: The daemon<br>utility detaches itself from the controlling terminal and executes the<br>program specified by its arguments. Privileges may be lowered to the<br>specified user. The output of the daemonized process may be redirected<br>to syslog and to a log file.<br><br>This requires that the program executed by daemon(8) stays attached to<br>the parent process - the daemon(8) supervisor.<br><br>Looking at gpg-agent(1) [2] options, I see a choice between:<br>--server - but it uses stdin instead of a socket for communication<br>(not sure if desirable)<br>--daemon - but it detaches itself from the spawning process<br>  (undesirable)<br>--supervised - seemingly fitting, but may require some utilities<br>specific to GNU/Linux<br><br>I usually run my services using the following template:<br>/usr/sbin/daemon -f -P "${pidfile_supervisor}" -p "${pidfile_daemon}"<br>-r -- gpg-agent --server|--supervised|--daemon<br>"-f" redirects standard input, standard output and standard error to<br>/dev/null<br>"-P" sets the path to the supervisor/daemon(8) pidfile<br>"-p" likewise, but for the child/gpg-agent<br>"-r" instructs the supervisor to restart the child process if it<br>terminates<br><br>This brings me to my question:<br>Is there a way to run gpg-agent in the foreground (like for --server<br>or --supervisor), but keep it listening to the standard socket (unlike<br>--server)? Or, in other words, like gpg-agent --daemon, but without<br>the detachment, so that it can stay glued to the daemon(8) process.<br><br>As a reference, I run Emacs in such way without any trouble - a simple<br>"daemon [options...] -- emacs --fg-daemon" suffices in that case.<br><br>~Artur<br><br>[1] https://www.freebsd.org/cgi/man.cgi?daemon(8)<br>[2] https://www.freebsd.org/cgi/man.cgi?gpg-agent(1)<br>