[Dxspider-support] Network Update

Keith Maton g6nhu at me.com
Mon Jan 30 09:35:10 GMT 2023


Yes, this is exactly how I’m doing it now, I stop the service via the system crontab (as root) and then restart it the same way.

But because Kin and Steve have said the spider crontab times are always UTC, it means I’ll need to remember to shift my timings in the system crontab twice a year when we change from UTC to BST and back again.

Dirk, just for my own sanity, can you confirm if the timings in the spider crontab are UTC or local time please?

Thanks,

73 Keith

> On 30 Jan 2023, at 09:22, Dirk Koopman via Dxspider-support <dxspider-support at tobit.co.uk> wrote:
> 
> Interesting question. The short answer is no.
> 
> A systemd unit installed by distro installed packages can only be controlled by the package owner, 99.8% of which will be root. But it *is* possible to install a systemd unit as a normal user and control it by that user. I have done this when I need to install stuff on Centoses that have stupidly old versions of perl. These necessitate running a more recent perl installed (using perlbrew) running as the sysop user. In that case I installed the dxspider.system unit, slightly modified, from within elsewhere in the /spider tree, rather than the usual place in /etc/systemd/system.
> 
> The only place you can do what you want is with the system crond. And the easiest way to that: is to 'sudo -s'; then do a 'crontab -e' put in your requirements in the normal crontab way and then exit the editor. This will then install that crontab (that you have just created) in the right place and execute it as 'root'.  Note: this is a completely separate crontab to any that are already controlled by any distro installed crontab controled jobs, so you can do what you need/like in it.
> 
> Does this help?
> 
> Dirk
> 
> On 30/01/2023 08:34, Keith Maton via Dxspider-support wrote:
>> Thanks Dirk.
>> 
>> It’s not the cluster I’m trying to shut down from within crontab, it’s another service.
>> 
>> I also tried writing a small perl script in /spider/local_cmd to stop the script, load that using load/cmd and call that script to stop the service.  It didn’t work either.
>> 
>> Is this something to do with it running under sysop and not under a root account?
>> 
>> Is there any way you can think of to stop and start a service using the spider crontab please?
>> 
>> Thanks,
>> 
>> 73 Keith
>> 
>> 
>>> On 30 Jan 2023, at 00:21, Dirk Koopman via Dxspider-support <dxspider-support at tobit.co.uk> <mailto:dxspider-support at tobit.co.uk> wrote:
>>> 
>>> Try this:
>>> 
>>> 50 00 * * * run_cmd("shutdown")
>>> 
>>> The system unit will restart the node immediately after it has shut itself down.
>>> 
>>> Dirk
>>> 
>>> On 29/01/2023 21:14, Keith Maton via Dxspider-support wrote:
>>>> Yes, yes I have.  I’ve been trying that today as it would be the perfect solution.
>>>> 
>>>> One of the commands I’m running through the system crontab is to stop a service.  I tried the same thing through the spider crontab.
>>>> 
>>>> I did some testing and this didn’t stop the service.   
>>>> 
>>>> 50 00 * * * spawn("sudo service xxx stop")
>>>> 
>>>> I tried using sudo systemctl stop xxx as well, no joy.  It shows in the debug log but the service doesn’t stop.
>>>> 
>>>> 1675025460^(cron) cron: 51 20 29 1 0 -> doing 'spawn("sudo systemctl stop xxx")'
>>>> 1675025460^(cron) DXCron::spawn: sudo systemctl stop xxx
>>>> 1675025460^(progress) subprocess stats cmd: 'sudo systemctl stop xxx' by DXCron::spawn 82mS
>>>> 
>>>> I’ve also tested using ‘ instead of “ because I have some spawn commands in my spider crontab with ‘ and some with “, neither work to stop the service.
>>>> 
>>>> Also tried this in case it needed the path.
>>>> 
>>>> 02 21 * * * spawn('sudo /usr/bin/systemctl stop xxx')
>>>> 
>>>> That also didn’t stop the service.
>>>> 
>>>> 1675026120^(cron) cron: 2 21 29 1 0 -> doing 'spawn('sudo /usr/bin/systemctl stop xxx')'
>>>> 1675026120^(cron) DXCron::spawn: sudo /usr/bin/systemctl stop xxx
>>>> 1675026120^(progress) subprocess stats cmd: 'sudo /usr/bin/systemctl stop xxx' by DXCron::spawn 90mS
>>>> 
>>>> 73 Keith
>>>> 
>>>>> On 29 Jan 2023, at 20:25, Kin EA3CV <ea3cv at cronux.net> <mailto:ea3cv at cronux.net> wrote:
>>>>> 
>>>>> And you haven't thought about centralizing everything in the spider crontab, it would be easier, I think.
>>>>> 
>>>>> Kin 
>>>>> 
>>>>> 
>>>>> Obtener Outlook para Android <https://aka.ms/AAb9ysg>
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Dxspider-support mailing list
>>>> Dxspider-support at tobit.co.uk <mailto:Dxspider-support at tobit.co.uk>
>>>> https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support
>>> 
>>> _______________________________________________
>>> Dxspider-support mailing list
>>> Dxspider-support at tobit.co.uk <mailto:Dxspider-support at tobit.co.uk>
>>> https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support
>> 
>> 
>> 
>> _______________________________________________
>> Dxspider-support mailing list
>> Dxspider-support at tobit.co.uk <mailto:Dxspider-support at tobit.co.uk>
>> https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support
> 
> _______________________________________________
> Dxspider-support mailing list
> Dxspider-support at tobit.co.uk
> https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.tobit.co.uk/pipermail/dxspider-support/attachments/20230130/383756fe/attachment.htm>


More information about the Dxspider-support mailing list