Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I use this Python script on my Debian based Guru Plug to make it work as a print server for Google Cloudprint. With this I can print from my Android devices using apps like PrinterShare or Cloud Print. It works perfectly.

However, I have to start the script manually if I for some reason have to reboot the plug computer. If would like to have it start automatically on boot, but so far I haven't succeded.

In /etc/rc.local I have this line:

/usr/bin/python /usr/local/bin/cloudprint -d

Using pgrep I can see that the script is running upon boot but it does not work. And redirecting output messages to a log file reveals that it ask for my Google username.

Normally it does not ask for authentification as this is stored in /root/.cloudprintauth. But obviously, when running from rc.local it is not able to read or find the file.

So my question is:

How do I enable the script to be able to find/read the authentification file when run from rc.local?

share|improve this question
1  
Have you read: Install Google Cloud Print on a Linux server? –  Pedro Romano Nov 16 '12 at 9:15
    
Yes, but I think it is overkill to install Chrome on a tiny little server like the Guru Plug with limited resources. The python script works fine except I don't know how to make it start properly on boot. –  marlar Nov 16 '12 at 10:27
add comment

2 Answers

up vote 1 down vote accepted

Unfortunately the script has the auth file path hard-coded relying on the shell expansion of the home directory:

self.auth_path = os.path.expanduser('~/.cloudprintauth')

My recommendation is that you patch the file by changing that line to an absolute path:

self.auth_path = os.path.expanduser('/root/.cloudprintauth')

Hopefully it will do the trick.

share|improve this answer
    
Thanks! That did it :) –  marlar Nov 16 '12 at 15:14
add comment

Here's a set of packages for Debian that will do this for you.

https://github.com/davesteele/cloudprint-debian

Install and run "service cloudprintd login" as root.

share|improve this answer
    
Thanks! I actually need to install the cloudprint script on my Raspi, so I will try this. –  marlar Jun 24 '13 at 8:47
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.