Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
How can I invoke poweroff from a script/process?
I’d like for my droplet image to do the following:
- Boot Ubuntu 20
- Start a process (using services.d or whatever)
- When the process finishes, invoke
- For the droplet to truly power off
I haven’t been able to make this work. The
poweroff command works from the CLI, if I am logged in as a user, even if the user is not a sudoer.
But if noone is logged onto the CLI, and the task finishes without a user being logged into the shell, the
poweroff command appears to have no effect.
How do I power off a droplet programmatically from a bash script?
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.×