Results 1 to 7 of 7

Thread: sudo service cups restart

  1. #1
    Join Date
    Jun 2009
    Beans
    75
    Distro
    Ubuntu

    Question sudo service cups restart

    On the PC used by all members of the family, ( running Lucid) the CUPS service often does not start at boot-up - hence no printer appears.

    I have instructed them in the use of the terminal command "sudo service cups restart", but I would like to either put this into an executable script they can run from an icon, or alternatively find where the cups service/app is run from in the filesystem, so I can create an application launcher for them.

    I'm a relative noob, so I have drawn a blank on both of the above so far.

    Hope someone can help with either ( or both ) solutions.

  2. #2
    Join Date
    Dec 2009
    Beans
    6,013

    Re: sudo service cups restart

    Ubuntu 10.04 has introduced two different bugs that affect how / when cups starts but only one seems to affect you.

    There are a lot of interrelated services that are dependent on the network being up before they can be started successfully. To ensure cups starts after the network is up:

    Create a script:
    Code:
    gksu gedit /etc/network/if-up.d/cups 
    With this content:
    Code:
    #!/bin/sh
    service  cups restart
    Save the file and make it executable:
    Code:
    sudo chmod +x /etc/network/if-up.d/cups
    Reboot

    Once set it should require no further intervention by the user.

  3. #3
    Join Date
    Jun 2009
    Beans
    75
    Distro
    Ubuntu

    Re: sudo service cups restart

    Thanks for that.

    So, as I understand it, your script runs automatically on boot to start the cups service if it's not already up and running at that point. It waits to see if the network is up first?

    Have I understood correctly?

    Cheers

    Gareth

  4. #4
    Join Date
    Dec 2009
    Beans
    6,013

    Re: sudo service cups restart

    So, as I understand it, your script runs automatically on boot to start the cups service if it's not already up and running at that point. It waits to see if the network is up first?

    Have I understood correctly?
    Exactly. Any script placed in /etc/network/if-up.d will execute only after the network is up.

  5. #5
    Join Date
    Jun 2009
    Beans
    75
    Distro
    Ubuntu

    Re: sudo service cups restart

    BIG THANKS!!

    All worked fine in the end

    Unless I typed something wrong, then,

    sudo chmod +x /etc/network/if-up.d/cups
    .....................didn't make the text file executable. However, I used a terminal and used....

    gksudo nautilus

    ... to browse to the file and tick the box on the permissions tab, which fixed it.

  6. #6
    Join Date
    Dec 2009
    Beans
    6,013

    Re: sudo service cups restart

    Hmm ......

    I cut and pasted my instructions into a terminal and the chmod +x changed it to executable.

    Code:
    -rw-r--r-- 1 root root    6 2010-08-11 12:41 cups
    -rwxr-xr-x 1 root root    6 2010-08-11 12:41 cups
    Oh well at least you worked around the issue and it worked.

  7. #7
    Join Date
    Jan 2008
    Beans
    44

    Re: sudo service cups restart

    thanks a lot guys

    it has fixed my printer too.

    with regards

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
  •