Re: Running script before reboot or shutdown

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




On Tue, Dec 22, 2020, at 08:12, centos2@xxxxxxxxxxxxxx wrote:
> 
> 
> On Tue, Dec 22, 2020, at 07:56, J Martin Rushton via CentOS wrote:
> > This could be the same issue that people run into when designing cron 
> > jobs.  You may only have a limited set of directories on you $PATH 
> 
> Is this a systemd limit? On one of my systems I've got 233 directories (5445 non-colon chars) in interactive shell PATH and generally things work fine.

I misunderstood your meaning about the PATH but I understand now. you're referring to the default path defined in the shell.
The Bash man page says, "The default path is system-dependent, and is set by the administrator who installs bash.", (so the CentOS packager?), and then continues on with "A common value is ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''." That covers putting the script in /usr/local/bin, but then, that might not be what's on your system. On the CentOS 7.9 system I am working with, the default is:

   /usr/bin:/bin

As reported by a very simple cron job that writes PATH to a file in tmp.
For cron jobs I usually use the full path to the script in the crontab then set and export the PATH in the script itself.

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]


  Powered by Linux