To make my life easy, I scheduled a cronjob for user flexshare
in /var/spool/cron/flexshare
0 12 * * 0 /install/script/recordingstart.sh
Cron.log
Nov 21 12:00:01 CROND[29827]: (flexshare) CMD (/install/script/recordingstart.sh)
Nov 21 12:00:01 CROND[29827]: (CRON) ERROR chdir failed (/dev/null): Not a directory
I did create a local home directory for flexshare
/home/flexshare (owner flexshare), but did does not do the job,., With user root everything is working as designed,
Any ideas ?
in /var/spool/cron/flexshare
0 12 * * 0 /install/script/recordingstart.sh
Cron.log
Nov 21 12:00:01 CROND[29827]: (flexshare) CMD (/install/script/recordingstart.sh)
Nov 21 12:00:01 CROND[29827]: (CRON) ERROR chdir failed (/dev/null): Not a directory
I did create a local home directory for flexshare
/home/flexshare (owner flexshare), but did does not do the job,., With user root everything is working as designed,
Any ideas ?
In Users
Share this post:
Responses (5)
-
Accepted Answer
-
Accepted Answer
If I run this as root, the script stores the content as root. Not a problem, but when I access this flexshare as a normal user, I don't have the "root" rights to delete or rename this item. Running this script with user flexshare eliminates this issue. BTW if I start the cronjob manually (I use webmin to start that job), this is working fine also. But if started via cron itself I have this issue. -
Accepted Answer
Ouch. If it is a single share, you could possibly investigate the SetUID or SetGID bit. Or can you put a recursive "chown" or "chuser"/"chgrp" at the end of your cron job? Otherwise you'll need to investigate giving "flexshare" some of root's permissions in /etc/sudoers or under /etc/sudoers.d/. The second option is probably the easiest. You wouldn't even need your flexshare user as you could use a proper user and/or group. -
Accepted Answer
Nick Howitt wrote:
Ouch. If it is a single share, you could possibly investigate the SetUID or SetGID bit. Or can you put a recursive "chown" or "chuser"/"chgrp" at the end of your cron job? Otherwise you'll need to investigate giving "flexshare" some of root's permissions in /etc/sudoers or under /etc/sudoers.d/. The second option is probably the easiest. You wouldn't even need your flexshare user as you could use a proper user and/or group.
After more investigation and tests, I decided to plan a chown on that particular directory at the end of every day ;-) . Thanks for helping again ! -
Accepted Answer
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »