[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[03/05] Embedded with systemd: systemd and weird triggers



Sometimes you only want services to start based on a "weird" trigger.
I have one use case where I only want a service to start once we have
received a valid GPS lock. With /sbin/init it looked like this:

#!/bin/bash
while [ <some bash that figures out if we have a lock> ]; do
   sleep 5; #wait for lock
done;
service &

with systemd I have to have

waitforgps.sh
waitforgps.service (Exec=waitforgps.sh)
service.service (After=waitforgps.service)

Is this really the best way?


Reply to: