[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Linux startup, Wheezy -- a required script won't run on startup, but can run manually without any trouble



On 06/09/2016 12:17 PM, Dan Purgert wrote:
> Andrew McGlashan wrote:
>> On 10/06/2016 5:06 AM, Dan Purgert wrote:
>>> Andrew McGlashan wrote:
>>>> [snip]
>>>> Now, I want the archiving script to run on system startup, I don't
>>>> want dovecot or exim4 to be running when the script starts, it
>>>> simply needs to have the /backup and /var file systems mounted to do
>>>> it's required job
>>>
>>> Looks like it might also need syslog running...
>>
>> Perhaps, but why?  I'm not asking it to log anything to syslog; just to
>> create it's own log file in the /var/log directory.
> 
> Just going off the comments at the top -- states "required-start:
> $syslog".  Although, I suppose that you could've just forgotten to
> remove that bit.
> 
>> [snip]
>> Weird artifcat of something (perhaps GPG due to signing?), my copy as
>> sent to the list is clean.  The script works perfectly if ran with an
>> interactive shell; right now the script isn't destructive, so I can run
>> it as many times as I like and it works fine.  The plan is to adjust the
>> script, I think you can see how, but not until it works as expected.
> 
> How are you calling it while logged in?  I'm starting to wonder if it's
> a difference between [da]sh and bash (or whatever your standard login
> shell is).  
> 
> Also, not entirely sure what the 'VER=$x" assignment is doing, as you
> don't seem to read $VER anywhere else.
> 
Something you might do just to see if the script is called at all is
to add a simple logging line right after the initial comments such as

echo $(date) mailarchive entered >>/tmp/mailarchive.log

If this proves that the script is called, then as Dan mentions, there
might be a shell incompatibility between what you use at the command
line and what the system shell is.  If so, add more echos until you
find the statement(s) which don't work.


Reply to: