When I run a service from a terminal it shows many logs/errors/successes in output. But if I run it with same command options as a service (under systemd on Debian Linux) it does not show any terminal window or any output. So where does that logs go? Is it redirected to /dev/null?
- This question is far too broad to answer without it stating the operating system, and indeed (for some operating systems) the choice of service management subsystem. Is it Solaris? AIX? void Linux?JdeBP– JdeBP2019-02-21 12:25:07 +00:00Commented Feb 21, 2019 at 12:25
- That's a kernel. You need to state the operating system, and for several Linux-based operating systems you need to further state the specific choice of service management tools.JdeBP– JdeBP2019-02-21 12:32:27 +00:00Commented Feb 21, 2019 at 12:32
Add a comment |
1 Answer
Issue the systemctl show --property=StandardOutput your.service command to see where the standard output of your service goes. The usual default is the systemd journal. You can dump the journal with the journalctl command (which has the --unit option to filter the output by service, but which is unreliable for short lived services). There is an analogous StandardError service property as well.
- Thanks for that option. I learned detailed explanation from FreeDesktop: systemd.exec.Biswapriyo– Biswapriyo2019-03-05 16:14:15 +00:00Commented Mar 5, 2019 at 16:14