Modify home manager systemd service

I want the home manager systemd service to print to console when restarted see : systemd.exec
I am running a long script to install doom emacs at onChange Advice needed installing doom-emacs - #8 by zeorin which just hangs the nixos-rebuild switch with no output, hence I want to add StandardOutput=journal+console to home-manager-user.service which will print the output of doom emacs script to console.

Is it possible to add StandardOutput to home manager service?

even if you can do it, i wouldn’t , as normal systemd services, or daemons, can be started with out a ‘visable’ or interactive tty.

the question is, how would it know what tty or ptty to write to, unless there is dark plumbing to say which tty issued a systemd restart command’.

However, you can probably write to the journal (syslog).

echo 'nixos is the future' | systemd-cat -t someapp -p emerg
journalctl -r | grep "someapp"
``

I think journal+console will use journal as default and only print to console if it is present.

journal+console and kmsg+console work in a similar way as the two options above but copy the output to the system console as well.

1 Like

cool! thats a new one me! :-)… .

Hosted by Flying Circus.