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

Re: Systemd e path parametrico.



On 10/26/2018 09:59 AM, Giuseppe Sacco wrote:
Ciao,

 > Sto scrivendo alcuni unit file per alcuni servizi custom.
> Siccome a priori non so dove verranno installati questi sevizi volevo scrivere qualcosa del genere
 >
 > ExecStart=${srvpath}/srv start

La pagina di manuale systemd.service parla chiaro: «the first argument must be an absolute path to an executable». E poi, nella sezione "command lines", aggiunge «Note that the first argument (i.e. the program to execute) may not be a variable.»

Il modo giusto di fare quello che vuoi è di calcolare il path assoluto al momento dell'installazione del servizio e scriverlo dentro allo unit file.

federico

--
Federico Di Gregorio                         federico.digregorio@dndg.it
DNDG srl                                                  http://dndg.it
 If a process is potentially good, but 90%+ of the time smart and
  well-intentioned people screw it up, then it's a bad process.
                                                          -- Steve Yegge


Reply to: