FreeBSD-12.2p9
On a FreeBSD host I have the following in the crontab for root:
When I rebooted this system I received this message:
The file `/var/spool/hp3000/scripts/np4179_rpt.job` has the following permissions:
Ir contains the following code:
I can run
What is the problem with this set up?
On a FreeBSD host I have the following in the crontab for root:
Code:
@reboot /usr/local/bin/bash -c '/var/spool/hp3000/scripts/np4179_rpt.job'
When I rebooted this system I received this message:
Code:
/usr/local/bin/bash: line 1: /var/spool/hp3000/scripts/np4179_rpt.job:
Permission denied
The file `/var/spool/hp3000/scripts/np4179_rpt.job` has the following permissions:
Code:
-rw-r--r-- 1 hp3000 hp3000 221 May 28 10:12 /var/spool/hp3000/scripts/np4179_rpt.job
Ir contains the following code:
Code:
export HPNP=4179 ; socat TCP4-LISTEN:${HPNP},bind=192.168.216.179,fork,reuseaddr,su=hp3000 SYSTEM:'gpcl6 -dNOSAFE -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=/var/spool/hp3000/np${HPNP}/HP3000-RPT-$(date -Iseconds).pdf -' &
I can run
/usr/local/bin/bash -c '/var/spool/hp3000/scripts/np4179_rpt.job'
from the command line as root and it starts without difficulty. I do not understand why it has a permission problem for root running from cron. I can see that the script is not owned by root, but that should make no difference since it can be read by anyone.What is the problem with this set up?