I am trying to start a process_A automatically (on startup) just after another process_B ends (which makes some updates in the system and needs the process_A to be off) and then if process_A crash or finish by error, restart.I was trying with a bash script like this:#!/bin/bash# Launch updater on startprocess_B# Launch process_Auntil process_Ado    # Restart in case of error/crash    echo process_A stopped with exit code $?.  Respawning.. >&2;    sleep 2;done# Shutdown systemshutdown -hP nowAnd the problem I have is how to launch this script correctly on start because if I use an autostart like$HOME/.conf/autostart/script_launcher.desktopthen process_A fails because there are some needed services that are not up yet I guess. If I launch this script manually, it runs with no errors.I was thinking on init.d service to start process_A on startup and respawn it automatically but i need to execute process_B before and only on startup.I'm using Debian Wheezy.
Autostart process and respawn only if error
debian;boot;process management