Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: wysiwyg on October 26, 2016, 03:27:34 PM

Title: at scheduler errors
Post by: wysiwyg on October 26, 2016, 03:27:34 PM
Good afternoon all, I've noticed several problems with the 'at' scheduler in both the Intel 32 and 64 bit extensions.  First, both require the flex.tcz dependency.  Secondly we need to add some additional lines to the /usr/local/tce.installed/atd file:

...snip...

Code: [Select]
if [ ! -d /var/at/atjobs ]; then
   mkdir -p /var/at/atjobs
   chown root:staff /var/at/atjobs
   chmod 775 /var/at/atjobs
fi

if [ ! -d /var/at/atspool ]; then
   mkdir -p /var/at/atspool
   chown root:staff /var/at/atspool
   chmod 775 /var/at/atspool
fi

if [ ! -e /var/at/atjobs/.SEQ ]; then
   touch /var/at/atjobs/.SEQ
   chown root:staff /var/at/atjobs/.SEQ
   chmod 660 /var/at/atjobs/.SEQ
fi

...snip...


There is also a missing /usr/local/etc/init.d/atd script:

Code: [Select]
#!/bin/sh
case $1 in
   start) atd ;;
   stop) kill $(pidof atd) ;;
   restart)
      $0 stop
      $0 start
      ;;
   *) echo "Usage $0: {start|stop|restart} ;;
esac


Lastly, even with these changes I still can't seem to have scheduled tasks run.  I'm getting an error "Can't signal atd (permission denied)", but have no clue why.  Any thoughts?

Thanks,
Dave

    [EDIT]: Added code tags.  Rich
Title: Re: at scheduler errors
Post by: wysiwyg on October 26, 2016, 04:23:26 PM
Update: starting atd with your user account makes everything work as designed, but this will not work in a multi-user system.  I've tried to start the daemon like:

su nobody -s /bin/sh -c /usr/local/sbin/atd

but it will not start...

Dave
Title: Re: at scheduler errors
Post by: wysiwyg on October 27, 2016, 10:12:51 AM
@juanito what account was used to run the software with during compilation?  Is there a compile script that I can download?

Thanks,
Dave
Title: Re: at scheduler errors
Post by: wysiwyg on October 27, 2016, 10:48:12 AM
@juanito what account was used to run the software with during compilation?  Is there a compile script that I can download?

Or more precisely, what account and group did you list in the configure script?  By default it uses 'daemon' for both, which is not a valid account in TC.

Dave
Title: Re: at scheduler errors
Post by: Misalf on October 27, 2016, 10:51:02 AM
Like these compile scripts?
http://tinycorelinux.net/7.x/x86/tcz/src/at/compile_at
http://tinycorelinux.net/7.x/x86_64/tcz/src/at/compile_at
Title: Re: at scheduler errors
Post by: wysiwyg on October 27, 2016, 02:25:54 PM
Thanks Misalf, that was exactly what I was looking for!  It also shows that the user and group accounts used for the extension is root - which explains some things. :)

Thanks again,
Dave
Title: Re: at scheduler errors
Post by: wysiwyg on October 27, 2016, 04:35:04 PM
@juanito After talking with the Debian team to get this working, it appears that you must setuid the 'at' binary (chmod 6755 at) and run the 'atd' daemon as the root user (since that's how it was compiled).  Let me know if you need me to make any of these changes.

Dave
Title: Re: at scheduler errors
Post by: Juanito on October 28, 2016, 02:56:39 AM
I'll look at it in a few days time
Title: Re: at scheduler errors
Post by: wysiwyg on October 28, 2016, 11:14:40 AM
Sounds good, thanks juanito
Title: Re: at scheduler errors
Post by: Juanito on November 01, 2016, 04:36:40 AM
modified extensions posted
Title: Re: at scheduler errors
Post by: wysiwyg on November 01, 2016, 02:40:48 PM
Hey juanito, thanks for updating the package!  Unfortunately there still seems to be some issues with it.  I had a typo in the provided init.d script:

*) echo "Usage $0: {start|stop|restart} ;;

should include a trailing " character:

*) echo "Usage $0: {start|stop|restart}" ;;

Also, there appears to be some weird characters in that script and /usr/local/tce.installed/at.  If you 'cat /usr/local/etc/init.d/at' script you can see what I'm talking about - it prevents execution.  Lastly, shouldn't that script actually be called 'atd' instead of 'at' to match the daemon?  Trivial change, but just thought I'd mention it. :)

Thanks,
Dave
Title: Re: at scheduler errors
Post by: Juanito on November 02, 2016, 07:29:02 AM
'not sure what happened there  :o

extensions re-posted