[Nix-dev] Basic commands not found in shell script when run from systemd

4levels 4levels at gmail.com
Wed Dec 30 14:00:29 CET 2015


Hi Domen,

Thank you for your quick reply, much appreciated!
Do I understand it correctly, if I put this line in the systemd
configuration

path = [ pkgs.procps pkgs.gawk pkgs.nettools pkgs.mysql pkgs.php
pkgs.duplicity];

I don't need to write the following inside the script itself?
script =

''
  export PATH="$PATH:${config.services.mysql.package}/bin"

  ...

Kind regards,

Erik

On Wed, Dec 30, 2015 at 1:47 PM Domen Kožar <domen at dev.si> wrote:

> path = [ pkgs.procps pkgs.gawk pkgs.nettools ];
>
> On Wed, Dec 30, 2015 at 1:43 PM, 4levels <4levels at gmail.com> wrote:
>
>> Hi Nix Devs,
>>
>> I've created a bash script that does a duplicity backup to an s3 instance
>> (but this is trivial).  When I run the script from cli, it works as
>> expected, but when this script is called from a systemd timer, I do get all
>> kind of errors about basic binaries not being found when using subshell
>> commands, like eg
>>
>> HOST=$(hostname) # (or HOST=`hostname`)
>>
>> The errors are like these:
>> hostname: command not found
>> ps: command not found
>> awk ..
>> sendmail ..
>>
>> Any ideas on what's going on so I can solve this and have this script
>> running correctly when started by systemd?
>>
>> Kind regards,
>>
>> Erik
>>
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20151230/7d002d8c/attachment.html 


More information about the nix-dev mailing list