<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
span.E-MailFormatvorlage18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-MailFormatvorlage19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.E-MailFormatvorlage20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-MailFormatvorlage21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.E-MailFormatvorlage22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-MailFormatvorlage23
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.E-MailFormatvorlage24
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.E-MailFormatvorlage25
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.E-MailFormatvorlage27
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-MailFormatvorlage28
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US">What operating system is this? I’m not sure why this is happening for you, but this might as well be just because you’re running the jobs in the system cron and the environment is
not being passed to the script upon execution.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US">Can you please just try to add this crontab line to the rancid user’s cron?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US">i.e. login as user rancid (f.ex. `su – rancid`) and then run `crontab -e` and add the cron there? This should definitely fix it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US">The only change necessary in the crontab line is to remove the column with the username „rancid“.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US">best,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><b><span lang="DE-AT" style="font-size:9.0pt;font-family:"Arial",sans-serif">Alexander Griesser<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="DE-AT" style="font-size:8.0pt;font-family:"Arial",sans-serif">Head of Systems Operations<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE-AT" style="font-size:8.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE-AT" style="font-size:9.0pt;font-family:"Arial",sans-serif">ANEXIA Internetdienstleistungs GmbH<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE-AT" style="font-size:8.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE-AT" style="font-size:8.0pt;font-family:"Arial",sans-serif">E-Mail:
<a href="mailto:AGriesser@anexia-it.com"><span style="color:blue">AGriesser@anexia-it.com</span></a>
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE-AT" style="font-size:8.0pt;font-family:"Arial",sans-serif">Web:
<a href="http://www.anexia-it.com/"><span style="color:blue">http://www.anexia-it.com</span></a>
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE-AT" style="font-size:8.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE-AT" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#595959">Anschrift Hauptsitz Klagenfurt: Feldkirchnerstraße 140, 9020 Klagenfurt<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE-AT" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#595959">Geschäftsführer: Alexander Windbichler<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE-AT" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#595959">Firmenbuch: FN 289918a | Gerichtsstand: Klagenfurt | UID-Nummer: AT U63216601<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext">Von:</span></b><span style="color:windowtext"> Rancid-discuss [mailto:rancid-discuss-bounces@shrubbery.net]
<b>Im Auftrag von </b>Vacheslav<br>
<b>Gesendet:</b> Mittwoch, 4. Oktober 2017 07:44<br>
<b>An:</b> 'Alex DEKKER' <rancid@ale.cx>; rancid-discuss@shrubbery.net<br>
<b>Betreff:</b> Re: [rancid] problem with rancid crontab<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">So how to change home from / to /var/rancid?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="RU" style="color:windowtext">From:</span></b><span lang="RU" style="color:windowtext"> Rancid-discuss [<a href="mailto:rancid-discuss-bounces@shrubbery.net">mailto:rancid-discuss-bounces@shrubbery.net</a>]
<b>On Behalf Of </b>Vacheslav<br>
<b>Sent:</b> Tuesday, October 3, 2017 5:59 PM<br>
<b>To:</b> 'Alex DEKKER' <<a href="mailto:rancid@ale.cx">rancid@ale.cx</a>>; <a href="mailto:rancid-discuss@shrubbery.net">
rancid-discuss@shrubbery.net</a><br>
<b>Subject:</b> Re: [rancid] problem with rancid crontab<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Good observation, I was creating it using winscp, now I nanoed it and the log file produced:<br>
export HOME="/"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">export LANG="en_US.utf8"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">export LOGNAME="rancid"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">export MAILTO="root"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">export OLDPWD<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">export PATH="/sbin:/bin:/usr/sbin:/usr/bin"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">export PWD="/"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">export SHELL="/bin/bash"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">export SHLVL="2"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">export USER="rancid"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">export _="/tmp/test2.sh"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">BASH=/bin/sh<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">BASH_ALIASES=()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">BASH_ARGC=()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">BASH_ARGV=()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">BASH_CMDS=()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">BASH_LINENO=([0]="0")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">BASH_SOURCE=([0]="/tmp/test2.sh")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">BASH_VERSINFO=([0]="4" [1]="3" [2]="48" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">BASH_VERSION='4.3.48(1)-release'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">DIRSTACK=()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">EUID=103<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">GROUPS=()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">HOME=/<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">HOSTNAME=nagios<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">HOSTTYPE=x86_64<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">IFS=' <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">LANG=en_US.utf8<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">LOGNAME=rancid<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">MACHTYPE=x86_64-pc-linux-gnu<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">MAILTO=root<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">OPTERR=1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">OPTIND=1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">OSTYPE=linux-gnu<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">PATH=/sbin:/bin:/usr/sbin:/usr/bin<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">PIPESTATUS=([0]="0")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">POSIXLY_CORRECT=y<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">PPID=22660<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">PS4='+ '<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">PWD=/<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">SHELL=/bin/bash<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">SHELLOPTS=braceexpand:hashall:interactive-comments:posix<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">SHLVL=2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">TERM=dumb<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">UID=103<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">USER=rancid<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">_=export<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">/<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="RU" style="color:windowtext">From:</span></b><span lang="RU" style="color:windowtext"> Rancid-discuss [<a href="mailto:rancid-discuss-bounces@shrubbery.net">mailto:rancid-discuss-bounces@shrubbery.net</a>]
<b>On Behalf Of </b>Alex DEKKER<br>
<b>Sent:</b> Tuesday, October 3, 2017 5:53 PM<br>
<b>To:</b> <a href="mailto:rancid-discuss@shrubbery.net">rancid-discuss@shrubbery.net</a><br>
<b>Subject:</b> Re: [rancid] problem with rancid crontab<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On 03/10/17 15:37, Vacheslav wrote:</span><span lang="EN-US" style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Well it didn’t run because when I su rancid and execute:<br>
/root $ /tmp/test.sh</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">bash: /tmp/test.sh: /bin/sh^M: bad interpreter: No such file or directory</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">running: sh /tmp/test.sh</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">produces a log file with the following content:</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">/root</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">How to fix the script?</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><span lang="EN-US"><o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif"><br>
If there really is a ^M on the first line of the script then that suggests it was created with "DOS" line endings. What are you using to edit files? I can imagine that unexpected DOS line endings will cause the various components of RANCID to fail in unexpected
ways.<br>
<br>
alexd<o:p></o:p></span></p>
</div>
</body>
</html>