Report this

What is the reason for this report?

systemctl not working on a fresh Ubuntu 18.04 build

Posted on November 10, 2019

fresh ubuntu 18.04 build created new user and switched to that user installed apache2, php, mysql, essentials using sudo apt-get

Works: sudo /etc/init.d/apache2 restart sudo systemctl status apache2

Does not Work: sudo systemctl restart apache2 after I hit enter nothing is executed, just another standard line(user@server:~$)

Please advise. Thanks.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

It is normal for the systemctl command not to provide you with any output after executing a restart command.

To check if the restart was successful, what you could do is run:

echo $?

This would provide you with the exit code of the previous command. If you get a 0 it means that it was successful, if you get 1 then something is wrong and you need to run the systemctl status command to get some more information.

Hope that this helps! Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.