build icon indicating copy to clipboard operation
build copied to clipboard

assure armbian-hardware-monitor starts after armbian-firmboot and excutes cleanup steps on system shutdown.

Open ThomasKaiser opened this issue 6 years ago • 4 comments

Since refactoring the services the stop case in armbian-hardware-monitor has become useless since never executed.

I tried to nail this down some time ago but to no avail. systemd NOOB still.

Related: To get nicer log output it would be great if armbian-hardware-monitor could wait for firstrun and resize2fs services to finish before starting to log. Also no idea how to achieve this.

ThomasKaiser avatar Aug 12 '18 09:08 ThomasKaiser

@ThomasKaiser

have any more details about what you mean by "since never executed" ?

I've just starting digging through the scripts and the forum to understand their role and make sense of it all.

lanefu avatar Sep 28 '18 02:09 lanefu

The armbian-hardware-monitor script has a start and a stop case. But the script will never be called on shutdown. I don't think it's needed to understand anything inside the script(s) since it boils down to how systemd handles such stuff (keeping the script active or not, executing it on shutdown/reboot).

ThomasKaiser avatar Sep 28 '18 05:09 ThomasKaiser

with systemd - calling init is calling systemd already - so the start/stop events in the script aren't particularly needed

sfx2000 avatar Oct 02 '18 23:10 sfx2000

Okay so according to the systemd.service docs, the unit file for the armbian-hardware-monitor service does the right thing and the shutdown cleanup steps should be happening.

Since the job is a oneshot, and has the RemainAfterExit flag is true, the ExecStop command is supposed to be executed.

see example 3 https://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples

Anyway that's the should.

The reality is that I'm not seeing ###shutdown logged anywhere in /var/log/armbian-hardware-monitor.log to indicate the stop command is actually happening...

I'm going to rename issue for clarity now that i understand it.

lanefu avatar Dec 19 '18 02:12 lanefu