[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



Hi,

Thanks for your reply.

On 10/06/2016 5:06 AM, Dan Purgert wrote:
> Andrew McGlashan wrote:
>> In the Solaris world and most SYSV systems like it, there was a very
>> simple startup system; it was not systemd, nor is it the "modern day"
>> sysvinit.  It was much simpler and worked very, very well and extremely
>> reliably.  How can we get that back on modern Debian?
>>
>> I mean simple, just like this:
>>
>>  - when entering a run level (start passed to each script)
>>
>>    - run all S scripts in alphanumeric order
>>      S02xxx before S03xxx and S02aaa before S02aab ...
>>
>>  - when exiting a run level (stop passed to each script)
>>
>>    - run all K scripts in alphanumeric order
>>      K02xxx before K03xxx and K02aaa before K02aab ...
> 
> That's pretty much sysvinit right there ... perhaps you're thinking of
> "Upstart" as the "modern sysvinit"?

That's what I thought, I have sysvinit.....

# dpkg-query -l|egrep -e '(sysvinit|systemd|upstart)'
ii  libsystemd-login0:amd64            44-11+deb7u4
amd64        systemd login utility library
ii  sysvinit                           2.88dsf-41+deb7u1
amd64        System-V-like init utilities
ii  sysvinit-utils                     2.88dsf-41+deb7u1
amd64        System-V-like utilities


>> Now I have sysvinit isntalled on wheezy, it is failing to run a simple
>> script during system boot (as part of a planed reboot) and I cannot work
>> out why.
> 
> What error messages (if any) are you getting?

None, no log is created.  The machine runs within a Xen KVM.  I can't
see any evidence the script is run during startup.

>> 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.

>> My script is meant to create a log file in the /var/log directory.  If I
>> run the script manually, it works perfectly.  There are some generic
>> parts in the script, it is a fairly simple script, even if a little bit
>> over complicated.  What do I need to do to fix it?
> 
> Not sure if this is an artifact of how you sent the mail to the group,
> but your ARCHIVE_DIR is "3D/backup/[...]".  That's not a valid path.

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.

Kind Regards
AndrewM

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: