You are not logged in.
Pages: 1
Dear Folks,
If I have e.g. a config error in my sshd_config running by hand
systemctl restart sshd.service
gives me no message wether the daemon was able to start or not.
But running stop followed by a start gives me:
systemctl stop sshd.service
systemctl start sshd.service
Job for sshd.service failed. See "systemctl status sshd.service" and "journalctl -xe" for details.
How can I turn on this behaviour by default. It is quite annoying to always run 'status' after a restart just to check if there was a problem. Even more if a start shows me the message in the terminal.
Thx
Offline
How about defining a bash function like
function systemctl-restart { systemctl stop $1; systemctl start $1 }
Offline
Dear Folks,
If I have e.g. a config error in my sshd_config running by hand
systemctl restart sshd.service
gives me no message wether the daemon was able to start or not.
But running stop followed by a start gives me:systemctl stop sshd.service systemctl start sshd.service Job for sshd.service failed. See "systemctl status sshd.service" and "journalctl -xe" for details.
How can I turn on this behaviour by default. It is quite annoying to always run 'status' after a restart just to check if there was a problem. Even more if a start shows me the message in the terminal.
Thx
Well, bug people at systemd-devel ML... I would do it myself, but I think there is little point because systemd's error reporting is terrible anyway (there are many other "quircks" like the one you found). For example, "job for sshd.service failed" does not mean that "sshd failed to start". So, when starting a new service, I'd suggest to not rely on systemctl no matter what it says (or doesn't say), but always check ps(1) and logs.
Last edited by Leonid.I (2015-01-16 19:40:49)
Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline
The restart doesn't execute stop&start; it sends a signal to the current process which has many benefits (for example; you can do it over an ssh connection). Doesn't the journal show anything when you execute the restart?
Offline
run journalctl as root to get all the output.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
The restart doesn't execute stop&start; it sends a signal to the current process which has many benefits (for example; you can do it over an ssh connection). Doesn't the journal show anything when you execute the restart?
You mean reload, not restart. These are different actions.
Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline
Spider.007 wrote:The restart doesn't execute stop&start; it sends a signal to the current process which has many benefits (for example; you can do it over an ssh connection). Doesn't the journal show anything when you execute the restart?
You mean reload, not restart. These are different actions.
I also think that thats the purpose of reload and restart really "restarts" the process (stop + start). And in my opinion it should give a message if it fails (or it worked). Just as during startup. There is an OK message ...
Of course I can always check the logs. But one should only go to the logs if something went wrong, and for that a message would be nice.
Offline
Pages: 1