Re: root crontab @reboot for loop fails

2022-07-16 Thread Nicolas George
Timothy M Butterworth (12022-07-16): > rc.local does not exist in Debian 11. "/etc/rc.local: No such file or > directory" should it be a file or a directory? rc.local is for compatibility with legacy admin practices. Somebody showed in this thread how it is implemented for systemd. In my opinion,

Re: root crontab @reboot for loop fails

2022-07-16 Thread Greg Wooledge
On Sat, Jul 16, 2022 at 12:06:38PM -0400, Timothy M Butterworth wrote: > rc.local does not exist in Debian 11. "/etc/rc.local: No such file or > directory" should it be a file or a directory? If you wish to use it, it must be a file, with execute permission, and with a valid shebang (#!/bin/sh).

Re: root crontab @reboot for loop fails

2022-07-16 Thread Timothy M Butterworth
On Fri, Jul 15, 2022 at 11:07 PM Greg Wooledge wrote: > On Sat, Jul 16, 2022 at 03:49:09AM +0100, Gareth Evans wrote: > > $ sudo crontab -l > > [...] > > @reboot for f in $(/usr/sbin/zfs list -t snap -o name|grep reboot); do > /usr/sbin/zfs destroy $f;done > > @reboot /usr/sbin/zfs snap -r

Re: root crontab @reboot for loop fails

2022-07-16 Thread Gareth Evans
> On 16 Jul 2022, at 14:39, Anssi Saari wrote: > > Tixy writes: > >> rc.local is still run on the latest Debian stable. You need to make >> sure it's a proper executable, i.e. starts with a shebang like >> '#!/bin/sh' and the file has execute permissions. > > Yes and that's because the

Re: root crontab @reboot for loop fails

2022-07-16 Thread Anssi Saari
Tixy writes: > rc.local is still run on the latest Debian stable. You need to make > sure it's a proper executable, i.e. starts with a shebang like > '#!/bin/sh' and the file has execute permissions. Yes and that's because the systemd package contains the rc-local.service which just runs

Re: root crontab @reboot for loop fails

2022-07-16 Thread Greg Wooledge
On Sat, Jul 16, 2022 at 08:13:56AM +0100, Tixy wrote: > On Sat, 2022-07-16 at 05:30 +0100, Gareth Evans wrote: > > I was of the impression (which I think it is fair to say has been created) > > that systemd had done away with /etc/rc.local > > rc.local is still run on the latest Debian stable.

Re: root crontab @reboot for loop fails

2022-07-16 Thread Greg Wooledge
On Sat, Jul 16, 2022 at 05:35:39AM +0100, Gareth Evans wrote: > On Sat 16 Jul 2022, at 05:30, Gareth Evans wrote: > > > Why isn't root's $PATH available to root crontab? ie. including the > > link /sbin -> /usr/sbin? > > By which I mean: why can't root crontab do everything sudo can do?

Re: root crontab @reboot for loop fails

2022-07-16 Thread Tixy
On Sat, 2022-07-16 at 05:30 +0100, Gareth Evans wrote: > I was of the impression (which I think it is fair to say has been created) > that systemd had done away with /etc/rc.local rc.local is still run on the latest Debian stable. You need to make sure it's a proper executable, i.e. starts with

Re: root crontab @reboot for loop fails

2022-07-15 Thread Gareth Evans
On Sat 16 Jul 2022, at 05:30, Gareth Evans wrote: > Why isn't root's $PATH available to root crontab? ie. including the > link /sbin -> /usr/sbin? By which I mean: why can't root crontab do everything sudo can do? Thanks G

Re: root crontab @reboot for loop fails

2022-07-15 Thread Gareth Evans
Hi Greg, On Sat 16 Jul 2022, at 04:07, Greg Wooledge wrote: [...] > "Well, read the email that cron sends you and see what the errors are." [amongst others] /bin/sh: 1: zfs: not found suggests the need for /usr/sbin/zfs It seems reasonable that /usr/sbin/* should be available to root

Re: root crontab @reboot for loop fails

2022-07-15 Thread Greg Wooledge
On Sat, Jul 16, 2022 at 03:49:09AM +0100, Gareth Evans wrote: > $ sudo crontab -l > [...] > @reboot for f in $(/usr/sbin/zfs list -t snap -o name|grep reboot); do > /usr/sbin/zfs destroy $f;done > @reboot /usr/sbin/zfs snap -r rpool@reboot > > > Prepending "/usr/sbin/" to "zfs" doesn't make a

Re: root crontab @reboot for loop fails

2022-07-15 Thread Gareth Evans
$ sudo crontab -l [...] @reboot for f in $(/usr/sbin/zfs list -t snap -o name|grep reboot); do /usr/sbin/zfs destroy $f;done @reboot /usr/sbin/zfs snap -r rpool@reboot Prepending "/usr/sbin/" to "zfs" doesn't make a difference. Thanks, Gareth

root crontab @reboot for loop fails

2022-07-15 Thread Gareth Evans
Hello, $ sudo crontab -l | grep reboot [...] [1] @reboot sleep 10; nmcli c up [2] @reboot for f in $(zfs list -t snap -o name|grep reboot); do zfs destroy $f;done [3] @reboot zfs snap -r rpool@reboot [1] succeeds, but [2,3] do not. Any ideas why would be gratefully received. Many thanks,