Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 36

Thread: 12.04 64-bit, "prettynames" cron job stopped running - need help

  1. #21
    Join Date
    Mar 2007
    Location
    Christchurch, NZ
    Beans
    3,239

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Quote Originally Posted by neutron68 View Post
    Correct - the system owner's username.

    I have tried both of these variations, and the script still doesn't run.
    Code:
    #!/bin/sh
    touch /var/log/cron/before-mythlink-line
    su - user1 /usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"
    touch /var/log/cron/after-mythlink-line
    Code:
    #!/bin/sh
    touch /var/log/cron/before-mythlink-line
    su - mythtv /usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"
    touch /var/log/cron/after-mythlink-line
    I just tried this from a command prompt and it didn't work - looks like a syntax error with the su command?
    Code:
    user1@Mythbuntu:/var/log/cron$ su - mythtv /usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"
    su: unrecognized option '--link'
    Usage: su [options] [LOGIN]
    
    Options:
      -c, --command COMMAND         pass COMMAND to the invoked shell
      -h, --help                    display this help message and exit
      -, -l, --login                make the shell a login shell
      -m, -p,
      --preserve-environment        do not reset environment variables, and
                                    keep the same shell
      -s, --shell SHELL             use SHELL instead of the default in passwd
    Try quoting the command you want su to run, like
    Code:
    su - user1 '/usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"'

  2. #22
    Join Date
    Oct 2007
    Location
    Minneapolis, MN
    Beans
    273
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    When I did this from a command line, it asked for a password. When I gave the password, it bombed out.
    Code:
    user1@Mythbuntu:~$ su - user1 '/usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"'
    Password:
    -su: /usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A": No such file or directory

  3. #23
    Join Date
    Mar 2007
    Location
    Christchurch, NZ
    Beans
    3,239

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Quote Originally Posted by neutron68 View Post
    When I did this from a command line, it asked for a password. When I gave the password, it bombed out.
    Code:
    user1@Mythbuntu:~$ su - user1 '/usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"'
    Password:
    -su: /usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A": No such file or directory
    It won't ask for a password when you do it as root.

  4. #24
    Join Date
    Oct 2007
    Location
    Minneapolis, MN
    Beans
    273
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Quote Originally Posted by nickrout View Post
    It won't ask for a password when you do it as root.
    But, I thought we don't WANT to run the script as root, so the password will be an issue, correct?

  5. #25
    Join Date
    Mar 2007
    Location
    Christchurch, NZ
    Beans
    3,239

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Quote Originally Posted by neutron68 View Post
    But, I thought we don't WANT to run the script as root, so the password will be an issue, correct?
    cron.hourly scripts run as root, which is why you want to use su - mythtv so that the REST of the line runs as user mythtv.

    In other words the script /etc/cron.hourly/prettynames initially runs as root, including the phrase

    Code:
    su - mythtv
    the remainder of that line is run as user mythtv, with user mythtv's environment.

    Because the phrase

    Code:
    su - mythtv
    is run as root, it will not ask for a password.

  6. #26
    Join Date
    Mar 2007
    Location
    Christchurch, NZ
    Beans
    3,239

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Bugger it we are missing -c, you left it out in one post above and I missed seeing that you missed it (if that makes sense)(none of which is your fault!)

    Try (as root)
    Code:
    su - mythtv -c '/usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"'
    Last edited by nickrout; September 3rd, 2012 at 05:50 AM.

  7. #27
    Join Date
    Oct 2007
    Location
    Minneapolis, MN
    Beans
    273
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Quote Originally Posted by nickrout View Post
    Bugger it we are missing -c, you left it out in one post above and I missed seeing that you missed it (if that makes sense)(none of which is your fault!)

    Try (as root)
    Code:
    su - mythtv -c '/usr/bin/mythlink.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"'
    That line works, IF I put the user1 name in, rather than mythtv. With mythtv in there, it doesn't produce output.

    Thank you for your help with this Nickrout!

    At this point, I'm still wondering why the prettynames scirpt worked OK calling the script without the "su - user1 -c" prior to Aug.21?

    I have learned that my friend did do some "apt-get update", "apt-get upgrade" command line commands during August. I'm thinking one of these updates choked off cron so it wouldn't work as before?

    Have there been any recent 'security updates' to cron that would have stopped my original prettynames script from running around Aug.21?

    Eric
    Last edited by neutron68; September 3rd, 2012 at 08:36 PM.

  8. #28
    Join Date
    Mar 2007
    Location
    Christchurch, NZ
    Beans
    3,239

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Could be the removal of mythrename in favour of mythlink.

  9. #29
    Join Date
    Oct 2007
    Location
    Minneapolis, MN
    Beans
    273
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Quote Originally Posted by nickrout View Post
    Could be the removal of mythrename in favour of mythlink.
    No, the mythrename script is still on the hard drive, where I manually put it.
    As a test, I just called the mythrename script from a command line and it still works fine.
    Code:
    su - user1 -c '/usr/bin/mythrename.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"'
    I'm still betting there was some change in cron rules that made the scripts stop running when called from inside /etc/cron.hourly.

    It would be cool if someone involved with system updates could verify my theory.

    Eric

  10. #30
    Join Date
    Mar 2007
    Location
    Christchurch, NZ
    Beans
    3,239

    Re: 12.04 64-bit, "prettynames" cron job stopped running - need help

    Quote Originally Posted by neutron68 View Post
    No, the mythrename script is still on the hard drive, where I manually put it.
    As a test, I just called the mythrename script from a command line and it still works fine.
    Code:
    su - user1 -c '/usr/bin/mythrename.pl --link /var/lib/mythtv/pretty --verbose --format "%T - %S - %Y-%m-%d, %g-%i %A"'
    I'm still betting there was some change in cron rules that made the scripts stop running when called from inside /etc/cron.hourly.

    It would be cool if someone involved with system updates could verify my theory.

    Eric
    does it still work as root though, without the su - user1 -c ?

    You will need to look at the changelog for for your cron daemon I guess.

Page 3 of 4 FirstFirst 1234 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •