Tell me more ×
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

2 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

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 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 at 10:15

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.