Re: [systemd-devel] empty a directory in service file as ExecStartPre

2016-01-02 Thread arnaud gaboury
On Sat, Jan 2, 2016 at 1:08 PM, Mantas Mikulėnas wrote: > ExecStart does not go through a shell, so it won't expand wildcards. OK. I understand now. > > Try running 'find /dir -mindepth 1 -delete', that also cleans up dotdirs. In my case, there is one more hurdle. Will post

Re: [systemd-devel] empty a directory in service file as ExecStartPre

2016-01-02 Thread Reindl Harald
Am 02.01.2016 um 13:43 schrieb arnaud gaboury: ExecStartPre=/usr/bin/rm -f ${REPORTDIR}/ ExecStartPre=/usr/local/scripts/emptydir.sh $REPORTDIR signature.asc Description: OpenPGP digital signature ___ systemd-devel mailing list

Re: [systemd-devel] empty a directory in service file as ExecStartPre

2016-01-02 Thread arnaud gaboury
On Sat, Jan 2, 2016 at 1:57 PM, Reindl Harald wrote: > > > Am 02.01.2016 um 13:43 schrieb arnaud gaboury: >> >> ExecStartPre=/usr/bin/rm -f ${REPORTDIR}/ > > > ExecStartPre=/usr/local/scripts/emptydir.sh $REPORTDIR Thank you, but I would prefer to avoid any external

Re: [systemd-devel] empty a directory in service file as ExecStartPre

2016-01-02 Thread Mantas Mikulėnas
ExecStart does not go through a shell, so it won't expand wildcards. Try running 'find /dir -mindepth 1 -delete', that also cleans up dotdirs. Alternatively 'sh -c "rm .../*" to handle wildcards. On Sat, Jan 2, 2016, 13:39 arnaud gaboury wrote: > I can't manage to

[systemd-devel] empty a directory in service file as ExecStartPre

2016-01-02 Thread arnaud gaboury
I can't manage to empty a directory as a Exec in a service file. Here is part: --- [Service] User=postgres Environment=REPORTDIR=/storage/psqlReport ExecStartPre=/usr/bin/rm -f ${REPORTDIR}/* ExecStart=MyCommand