WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: at scheduler errors  (Read 4172 times)

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
at scheduler errors
« 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
« Last Edit: October 26, 2016, 04:29:35 PM by Rich »

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: at scheduler errors
« Reply #1 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

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: at scheduler errors
« Reply #2 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

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: at scheduler errors
« Reply #3 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

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Download a copy and keep it handy: Core book ;)

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: at scheduler errors
« Reply #5 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

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: at scheduler errors
« Reply #6 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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: at scheduler errors
« Reply #7 on: October 28, 2016, 02:56:39 AM »
I'll look at it in a few days time

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: at scheduler errors
« Reply #8 on: October 28, 2016, 11:14:40 AM »
Sounds good, thanks juanito

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: at scheduler errors
« Reply #9 on: November 01, 2016, 04:36:40 AM »
modified extensions posted

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: at scheduler errors
« Reply #10 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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: at scheduler errors
« Reply #11 on: November 02, 2016, 07:29:02 AM »
'not sure what happened there  :o

extensions re-posted