Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

After installing a Canon printer in Quantal, in order to print I have to start ccpd at each restart with the command

sudo /etc/init.d/ccpd start

This should be automated, says the driver manual. But before doing that, I believe that a script for that command must be created. Or is there a way to make the command run at startup without creating a script first? Whether a script must created or not, I guess a different command should be used, one that doesn't open the terminal and doesn't ask for the password each time.

I guess the answer might be like here, editing /etc/rc.local. That file looks like this:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0

But what should I do: just paste the command in the line 13 before exit 0? And what the command should be exactly?

(A supplementary question that I should ask is maybe this: should that command be put to start with the computer or only at login, or is that unimportant?)


Considering similar questions on Askubuntu, beside the fact that I am not sure what the command is:

  • this looks promising, but the answer was not set as definitive, and I need more advice. Also, I am in Lubuntu and do not have the Ubuntu GUI that adds stuff at startup. The same for this.

  • also this: but its answer only concerns where to put the script not how to create it, and I guess the comment there drastically amends the answer ("~/.profile (which also calls ~/.bashrc) is only executed when logging into a shell (through Terminal or SSH for example). Not when logging into the GUI")

share|improve this question
add comment

4 Answers

up vote 1 down vote accepted

You will need to assign it a run-level. Something like this should do it:

  sudo update-rc.d ccpd defaults

Here is some more information:

http://manpages.ubuntu.com/manpages/hardy/man8/update-rc.d.8.html

share|improve this answer
add comment

This should add it to the autostart:

sudo update-rc.d ccpd defaults

share|improve this answer
    
both answers are identical the other one a few minutes earlier so i put that as definitive. –  cipricus Jan 23 '13 at 10:08
1  
I think i was on the page for a few minutes before i answered, so didn't see the other pop up, so fair enough :) –  ScottC Jan 23 '13 at 10:15
add comment

I succeeded to autostart the ccpd deamon on Ubuntu 13.04 by adding sudo /etc/init.d/ccpd start to the startup-applications.

Update:

This stopped working for me some time ago. When I entered sudo /etc/init.d/ccpd status in a terminal it returned one number in stead of two.

Starting the ccpd deamon was no longer posible without stopping it first, so I had to enter sudo /etc/init.d/ccpd stop en then sudo /etc/init.d/ccpd start in a terminal.

It made no difference whether I added sudo update-rc.d ccpd defaults, sudo /etc/init.d/ccpd start or nothing at all to the startup-applications. I also tried ibrahims method. ccpd status returned just one number.

The solution:

I added

sudo /etc/init.d/ccpd stop

sudo /etc/init.d/ccpd start

to /etc/rc.local.

I added nothing to the startup-applications

share|improve this answer
add comment

I have looked a long time on the internet how to get it starting automatically. I proceeded as follows:

  1. I read canon's manual in next link: http://software.canon-europe.com/files/soft28622/readme/README-capt-1.6xE.txt

  2. Reading how to login as root in ubuntu 13.04 in next link: http://linuxg.net/enable-login-as-root-on-ubuntu-13-04/

Then I proceeded as follows:

  • open terminal:
  • enterred sudo passwd root
  • used same password as normally (2x)
  • entered sudo su
  • entered: echo 'greeter-show-manual-login=true' >> /etc/lightdm/lightdm.conf
  • exited terminal
  • logged-off
  • logged in using the word root as login and the chosen password (I had filled in in the terminal)
  • Opened Nautilus - clicked on (computer on the left hand side and then) the folder /etc - scrolled down and found the file rc.local
  • opened the file: added the line /etc/init.d/ccpd start just before line exit 0
  • saved the file
  • opened terminal (still as root otherwise you will not be able to shut down pc) and entered sudo passwd -l root to disable root.
  • logged-out as root
  • logged in as normal user
  • shut down pc
  • restarted pc
  • opened terminal and used command line sudo /etc/init.d/ccpd status to check status.

I got it to work.

Important previous steps I took, but which I do not really know are neccesary: I added to startup applications

  1. sudo update-rc.d ccpd defaults
  2. sudo /etc/init.d/ccpd start

This is how I proceeded and it worked. There is probably an easier way, but this procedure garanties it will start up automatically.

Greetings

share|improve this answer
    
this answer helped me, I didn't logged-in as root (cuz I failed at it) and didn't need start-up-apps. I think both measures are not needed. I also needed to add an extra line to /etc/rc.local (see my own answer). Thanx –  user154126 Sep 7 '13 at 0:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.