Results 1 to 8 of 8

Thread: Crontabs and www-data user

  1. #1
    Join Date
    Mar 2010
    Beans
    4

    Crontabs and www-data user

    Hello !

    I have problem with crontabs. I have Ubuntu 9.04 Desktop. I install in my ubuntu mpg321 music player. In system I have 3 crontabs in:
    Code:
    /var/spool/cron/crontabs/
    
    osa2t
    root
    www-data
    When I add cron jobs

    Code:
    * * * * * mpg321 /path.../1.mp3
    In osa2t and root jobs works correct (I have music in speaker) , but in www-data user don't play any sound. If I add other jobs example to put some data to SQL, jobs works correct in all user.
    So my quastion is why mpg321 software don't work in www-data? How I can fix this?

  2. #2
    Join Date
    Apr 2006
    Location
    UK
    Beans
    555
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Crontabs and www-data user

    you should have the FULL path to your music player in the Cron eg

    usr/bin/musicplayer not just musicplayer.

    Steve
    Intel Pentium Dual Core 2.6 Ghz 2 Gb ram, Asus P5KPL motherboard, 2.5 TB Storage running Hardy.
    HP Pentium 4 2.8 Ghz 756 mb ram running Intrepid.

  3. #3
    Join Date
    Mar 2010
    Beans
    4

    Re: Crontabs and www-data user

    Hello mister P,

    I try run crobjobs with full path, and it's works only in osa2t and root crontable not in www-data (apache) user. Maybe You have other idea what I can do ?

  4. #4
    Join Date
    Apr 2006
    Location
    UK
    Beans
    555
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Crontabs and www-data user

    Hmm, well heres what I do to play music on a cron:

    # Start Radio Paradise
    32 08 * * 1-5 DISPLAY=0 && /usr/bin/cvlc http://www.radioparadise.com/musiclinks/rp_128.m3u

    This launches a command line version of VLC, might be worth ditching mpg321 in favour of this.
    Steve
    Intel Pentium Dual Core 2.6 Ghz 2 Gb ram, Asus P5KPL motherboard, 2.5 TB Storage running Hardy.
    HP Pentium 4 2.8 Ghz 756 mb ram running Intrepid.

  5. #5
    Join Date
    Apr 2006
    Location
    UK
    Beans
    555
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Crontabs and www-data user

    Quote Originally Posted by osa2t View Post
    Hello !

    I have problem with crontabs. I have Ubuntu 9.04 Desktop. I install in my ubuntu mpg321 music player. In system I have 3 crontabs in:
    Code:
    /var/spool/cron/crontabs/
    
    osa2t
    root
    www-data
    When I add cron jobs

    Code:
    * * * * * mpg321 /path.../1.mp3
    In osa2t and root jobs works correct (I have music in speaker) , but in www-data user don't play any sound. If I add other jobs example to put some data to SQL, jobs works correct in all user.
    So my quastion is why mpg321 software don't work in www-data? How I can fix this?
    Could be the user name is confusing the system? does ANY cron job work in www-data?

    Steve
    Intel Pentium Dual Core 2.6 Ghz 2 Gb ram, Asus P5KPL motherboard, 2.5 TB Storage running Hardy.
    HP Pentium 4 2.8 Ghz 756 mb ram running Intrepid.

  6. #6
    Join Date
    Mar 2010
    Beans
    4

    Re: Crontabs and www-data user

    I check cvlc and he works only in osa2t user, www-data don't play any sound (I check local mp3 and internet link to radio from You) so maybe it not software player is problem, maybe www-data user don't have powers to use audio device? but I don't have idea how I can check this. I don't have other cronjobs is www-data user. If user name is confusing the system? I don't know, it's standard user when I install apache server.

  7. #7
    Join Date
    Jul 2007
    Location
    Burlington, NC
    Beans
    1,995
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Crontabs and www-data user

    are you running pulseaudio?
    If so, www-data probably isn't allowed to playback sound.
    Give me Free Software or Give me Death!

  8. #8
    Join Date
    Mar 2010
    Beans
    4

    Re: Crontabs and www-data user

    yes I have run demon pulseaudio. If I kill process "pulseaudio -k" I don't have any music in all user. If I play some music and after that I kill pulseaudio me music is turn off.

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
  •