On Sat, 02.04.11 01:11, Vasiliy G Tolstov (v.tols...@selfip.ru) wrote: > Hello. I have a daemon, that runs before init system, it do some things > and must sleep before system go to 3 or 5 runlevel. > That is the best way to waiting ? I'm not only using systemd, but other > init systems too... > Very simple method - in cycle parse /var/log/wtmp (/var/log/wtmpx) and > get current runlevel, but does it exists more elegant way to do whis?
systemd still maintains wtmp with something resembling a runlevel. Note however that systemd actually doesnt know runlevels really, and just emulates them. If you care for a solution that woirks everywhere, and you want to monitor this, use inotify on wtmp. If you do not care for other init systems use D-Bus to subscribe to systemd PropertyChange events on the targets you are interested in. Lennart -- Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel