acme.sh icon indicating copy to clipboard operation
acme.sh copied to clipboard

acme.sh should provide a username in crontab entry

Open heeplr opened this issue 3 years ago • 5 comments

When installing the cronjob, acme.sh generates /etc/cron.d/acme.sh with: 35 0 * * * /usr/bin/acme.sh --home "/etc/acme-sh/" --config-home "/etc/acme-sh/" --cron

When running the cronjob, an error is generated: crond[10986]: (/usr/bin/acme.sh) ERROR (getpwnam() failed - user unknown)

crond needs to know what user to run acme.sh as. The error goes away when fixing the crontab entry: 35 0 * * * root /usr/bin/acme.sh --home "/etc/acme-sh/" --config-home "/etc/acme-sh/" --cron

heeplr avatar Jun 10 '22 10:06 heeplr

what is your OS version?

Neilpang avatar Jun 11 '22 07:06 Neilpang

Gentoo Base System release 2.8 but I suppose it applies to any vixie-cron compatible crond (I'm using cronie).

A username must be supplied when a system crontab entry is installed (/etc/crontab or /etc/cron.d/). I believe the ideal way would be to use the "crontab" executable to install a user crontab (you can define your own environment then for example), but just adding the user column to the current entry should be fine aswell.

(Linked the github man page because I don't know another way to link to specific sections)

heeplr avatar Jun 11 '22 08:06 heeplr

you can either edition the crontab entry by your self, or try with virtual/cron

Neilpang avatar Jun 18 '22 07:06 Neilpang

@Neilpang Thank you. Yes, that's how everybody is doing it. Just wanted to tell you, that cron needs to know which user to run the cronjob as.

heeplr avatar Jun 19 '22 15:06 heeplr

I have the same issue on a Docker install (under Synology DSM 7).

papukj avatar Jul 21 '22 07:07 papukj