Search This Blog

Showing posts with label classic. Show all posts
Showing posts with label classic. Show all posts

Tuesday, December 01, 2015

Cloud Print on an old local printer

add printer in local cups. make sure it prints. some printers require loading a firmware stub. in my /etc/rc.d/rc.local I have the following line:
/usr/share/hplip/firmware.py -n -p HP_LaserJet_1020



open chrome as a normal user (in our case luser23)
go to chrome://devices/
click add printer. follow instructions.

create the following init script and make sure is executed at startup

cat /etc/init.d/cloudprint

#!/bin/sh
#
# Start / Stop cloudprint daemon
#
# description:  Start / Stop cloudprint daemon
# chkconfig: 345 99 9
#
### BEGIN INIT INFO
# Provides: cloudprint
# Default-Start: 3 4 5
# Short-Description:  Start / Stop cloudprint daemon
# Description:  Start / Stop cloudprint daemon
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

# config file
CONF=/etc/cloudprint.conf

[ -r $CONF ] && . $CONF
[ -r $CONF ] || user=luser23
[ -r $CONF ] || options="/opt/google/chrome/chrome --type=service --enable-cloud-print-proxy --noservice-autorun --noerrdialogs --disk-cache-size=1 --media-cache-size=1 --disk-cache-dir=/tmp/chrome.$$ &"

# See how we were called.
case "$1" in
  start)
 gprintf "Starting cloudprint: "
 /usr/bin/su -l $user -c "$options" && success || failure
 echo
 ;;
  stop)
 gprintf "Shutting down cloudprint:"
 killproc chrome && success || failure
 echo
 ;;
  status)
 status chrome
 ;;
  restart)
 $0 stop
 $0 start
 ;;
  *)
 gprintf "Usage: %s\n" "$0 {start|stop|restart|status}"
 exit 1
esac
exit 0


cat /etc/cloudprint.conf

user=luser23
options="/opt/google/chrome/chrome --type=service --enable-cloud-print-proxy --no-service-autorun --noerrdialogs --disk-cache-size=1 --media-cache-size=1 --disk-cache-dir=/tmp/chrome.$$ &"



or just add in /etc/rc.d/rc.local the following line:
su -l luser23 -c '/opt/google/chrome/chrome --type=service --enable-cloud-print-proxy --no-service-autorun --noerrdialogs --disk-cache-size=1 --media-cache-size=1 --disk-cache-dir=/tmp/chrome.$$ '