I am sorry for the delay of my response. And thank you so much for teaching me on the working flow. I do find it really helpful.
I tested with the following configurations (Let’s call it
torrcd.conf for now):
d /usr/local/etc/torrc.d/ 0755 root staff
f /usr/local/etc/torrc.d/40_anon_connection_wizard.conf 0755 root staff
f /usr/local/etc/torrc.d/50_user.conf 0755 root staff
user@host:~$ cat /etc/torrc.d/95_whonix.conf
## Do not edit this file!
## Please create and add modifications to the following file instead:
It partly works as expected but here are some problems:
systemd-tmpfile will only auto execute once at boot time, which means when
/usr/local/etc/torrc.d/50_user.conf is deleted somehow after the boot up, and then when user would like to restart Tor again, Tor will fail to start, unless they reboot or manually execute
systemd-tmpfile. Therefore, it would be helpful if we could find a way to make sure those directory and files exist by using
If we decide to go for
tmpfiles rather than
ExecStartPre, we should put the
torrcd.conf in a Whonix-Gateway-Only package instead of anon-connection-wizard package. Because even if it is related to the anon-connection-wizard, we should assume Whonix without anon-connection-wizard installed should also work.
It seems postinst snippets are all containing other components for example:
case "$1" in
adduser --home /nonexistent --quiet --system --group whonixcheck || true
## Compatibility with anon-ws-disable-stacked-tor.
addgroup debian-tor 2>/dev/null || true
## Add whonixcheck to group debian-tor so it can read
## /var/run/tor/control.authcookie which is required to check for Tor
## bootstrap test.
addgroup whonixcheck debian-tor
Do we also need somethign similar to this part? Or do we just need:
## workaround for 'dh_installinit should run systemd-tmpfiles if a
## /usr/lib/tmpfiles.d/ snippet gets shipped for systemd-only packages
## also' - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=795519
# In case this system is running systemd, we need to ensure that all
# necessary tmpfiles (if any) are created before starting.
if [ -d /run/systemd/system ] ; then
systemd-tmpfiles --create /usr/lib/tmpfiles.d/torrcd.conf >/dev/null || true
true "INFO: debhelper beginning here."