start order services / "motion" Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
pakikje
Posts: 124
Joined: Fri Nov 11, 2016 3:04 pm

start order services / "motion"

Post by pakikje »

Hi guys,

I added "motion" to dietpi and added it to crontab. (@reboot motion) After that i noticed that "motion" doesn't always launch after a reboot. I then added "sleep 60 & motion" to cron. That runs fine (every reboot). Now i noticed that (when i "dietpi-backup 1") All services get stopped, but motion always keeps running.

How do i add "motion" to the dietpi-services? Is it possible to run it BEFORE lighttpd?

Greetz: Patrick
pakikje
Posts: 124
Joined: Fri Nov 11, 2016 3:04 pm

Re: start order services / "motion"

Post by pakikje »

Allright, looked a little further: /DietPi/dietpi/.dietpi-services_include_exclude

But can i adjust the order in which the services are run?

ps: the reason for why i want "motion" to run before "lighttpd": In Homeassistant i link to motion (webcams) and the images are perfectly synchronized WHEN motion is started before lighttpd is. When motion is started AFTER lighttpd, the images and the refresh of the website (homeassistant) are out of sync. (out of sync = images are blank for a couple of seconds)

ps: motion get's stopped nicely now when i do a dietpi-backup but is not automatically started after the dietpi-backup (the other services are)
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: start order services / "motion"

Post by MichaIng »

@pakikje
Currently it is not natively possible to order custom services into the hard coded services start schedule. They are always executed afterwards.

But you can manually edit /DietPi/dietpi/dietpi-services and hard code your service into the list, the long array where you find lighttpd inside as well. Simply add it as separate line before 'lighttpd'.

Note that this is overwritten with every DietPi update, implementing a native solution should be possible (I have an idea), but could take one or two versions longer.
pakikje
Posts: 124
Joined: Fri Nov 11, 2016 3:04 pm

Re: start order services / "motion"

Post by pakikje »

thnx for the info!
Post Reply