[Bug 1102897] New: cronjobs (/etc/cron.d/*) ignore proxy setting (and other env variables)
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1102897 Bug ID: 1102897 Summary: cronjobs (/etc/cron.d/*) ignore proxy setting (and other env variables) Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.0 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: bnc-team-screening@forge.provo.novell.com Reporter: duge@pre-sense.de QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Cronjobs started via /etc/cron.d/* ignore the proxy server, set via YaST->Proxy, because the corresponding environment variables aren't set. Actually those cronjobs miss even more environment variables like JRE_HOME. So this might not just affect the use of proxy servers. -- Proxy server relevant variables: NO_PROXY, http_proxy, ftp_proxy, https_proxy, no_proxy and maybe: gopher_proxy Tested with openSUSE-42.3 and openSUSE-15.0. Also did a restart after setting the proxy via YaST. But I actually need the proxy settings to work without a restart for my scenario. -- Workaround: */1 * * * * root su -c '/actual/cron/job' - Mind the trailing "-"! By this, su will load the needed environment variables. -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1102897 http://bugzilla.suse.com/show_bug.cgi?id=1102897#c2 --- Comment #2 from Moritz Duge <duge@pre-sense.de> --- OK Side note: Found a maybe better way to get the proxy variables than "su". You need to source: /etc/profile.d/profile.sh E.g. one of these: . /etc/profile.d/profile.sh source /etc/profile.d/profile.sh bash -c '. /etc/profile.d/profile.sh; COMMAND-YOU-WANT-TO-RUN' -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com