[systemd-devel] Clarification on unit state meanings

2017-08-09 Thread James Forcier
Hey all, I noticed some odd ways `systemctl status` reports the status of units when they're enabled via symlinks in target.{wants,requires} directories in /usr. In particular, units with Install sections enabled this way show as disabled, although they start with the target as expected. I've

Re: [systemd-devel] question about system reboot and shutdown

2017-08-09 Thread Lennart Poettering
On Mi, 09.08.17 11:28, Tilman Baumann (til...@baumann.name) wrote: > In my experience, the only place where you can hook in a non racy way is > in the kernel. I fully agree with this btw. The only safe place if the kernel does all this. Much like most other drivers UPS drivers should be in the

Re: [systemd-devel] question about system reboot and shutdown

2017-08-09 Thread Lennart Poettering
On Mi, 09.08.17 11:02, Marek Floriańczyk (marek.florianc...@gmail.com) wrote: > The question is, will my binary be able to open RS232 port eg. /dev/ttyACM0 > when filesystem is Read-Only ? Yes, /dev is unaffected. It's an API VFS, not a real file system, and those won't be remounted r/o. > And

Re: [systemd-devel] question about system reboot and shutdown

2017-08-09 Thread Marek Floriańczyk
Dnia środa, 9 sierpnia 2017 14:54:25 CEST piszesz: > 2017-08-09 14:51 GMT+02:00 Marek Floriańczyk : > > Dnia środa, 9 sierpnia 2017 11:51:07 CEST Tilman Baumann pisze: > >> On 09.08.2017 11:28, Tilman Baumann wrote: > > NUT looks like quite active based on their

Re: [systemd-devel] question about system reboot and shutdown

2017-08-09 Thread Michael Biebl
2017-08-09 14:51 GMT+02:00 Marek Floriańczyk : > Dnia środa, 9 sierpnia 2017 11:51:07 CEST Tilman Baumann pisze: >> On 09.08.2017 11:28, Tilman Baumann wrote: > > NUT looks like quite active based on their website. > Microupsd daemon handles also some switches and leds

Re: [systemd-devel] question about system reboot and shutdown

2017-08-09 Thread Marek Floriańczyk
Dnia środa, 9 sierpnia 2017 11:51:07 CEST Tilman Baumann pisze: > On 09.08.2017 11:28, Tilman Baumann wrote: > > DL;DR > > UPS shutdowns are tricky. Clean file-systems are not the only concern. > > But if you can make assumptions about your storage backend you might be > > able to cut corners

Re: [systemd-devel] question about system reboot and shutdown

2017-08-09 Thread Marek Floriańczyk
Dnia środa, 9 sierpnia 2017 09:17:44 CEST Mantas Mikulėnas pisze: > /dev is a separate filesystem and is never read-only. right ;) > > Another approach would be to let microupsd exit normally, but then start a > separate microupsd instance (e.g. microupsd-shutdown.service) which > schedules the

Re: [systemd-devel] question about system reboot and shutdown

2017-08-09 Thread Tilman Baumann
On 09.08.2017 11:28, Tilman Baumann wrote: > DL;DR > UPS shutdowns are tricky. Clean file-systems are not the only concern. > But if you can make assumptions about your storage backend you might be > able to cut corners safely. > > In my experience, the only place where you can hook in a non racy

Re: [systemd-devel] question about system reboot and shutdown

2017-08-09 Thread Tilman Baumann
DL;DR UPS shutdowns are tricky. Clean file-systems are not the only concern. But if you can make assumptions about your storage backend you might be able to cut corners safely. In my experience, the only place where you can hook in a non racy way is in the kernel.

Re: [systemd-devel] question about system reboot and shutdown

2017-08-09 Thread Mantas Mikulėnas
/dev is a separate filesystem and is never read-only. Another approach would be to let microupsd exit normally, but then start a separate microupsd instance (e.g. microupsd-shutdown.service) which schedules the UPS poweroff. On Wed, Aug 9, 2017, 12:03 Marek Floriańczyk

Re: [systemd-devel] question about system reboot and shutdown

2017-08-09 Thread Marek Floriańczyk
Dnia środa, 9 sierpnia 2017 10:29:37 CEST Lennart Poettering pisze: > On Di, 08.08.17 16:03, Marek Floriańczyk (marek.florianc...@gmail.com) wrote: > > Hi all, > > > > I have a small device MicroUPS which helps me to shutdown my system on > > embedded devices, it is controlled by script

Re: [systemd-devel] timesyncd equivalent to ntp-wait

2017-08-09 Thread Lennart Poettering
On Di, 08.08.17 09:13, Shawn Johnson (shawn.john...@spensatech.com) wrote: > I need to be able to start a service only after time synchronization has > occurred. I implemented this as a systemd target with ntpd and ntp-wait > but I can't find an equivalent for timesyncd. I found a couple

Re: [systemd-devel] question about system reboot and shutdown

2017-08-09 Thread Jérémy Rosen
Hi I have no problem with changing some code in microupsd so it behave in certain way. It is handling SIGTERM and other signals if needed. The problem for me is that SIGTERM is send to process during system reboot and system halt - so I need to differentiate between the two. SIGTERM is sent, by