You are not logged in.

#1 2015-02-09 20:56:18

shaolintl
Member
From: Paris, France
Registered: 2015-02-09
Posts: 2

Configuring two cups servers

Hi,

I have just installed arch and my problem might be completely trivial. I apologize if that is the case.

I am trying to configure my cups client as follows. At work I am connecting to a remote cups server and at home I have a local(host) cups server. My home printer is HP Deskjet 3520.
When setting the remote cups server in /etc/cups/client.conf I am able to print to the network printers. I was also able to install my printer using the web interface and then install hplip (as described here: https://wiki.archlinux.org/index.php/CUPS#HP_Printer). The problem is that it doesnt recognize the cups server and  $ lpstat -t returns

scheduler is not running
no system default destination
lpstat: Bad file descriptor
lpstat: Bad file descriptor
lpstat: Bad file descriptor
lpstat: Bad file descriptor
lpstat: Bad file descriptor

By replacing the remote cups server with ServerName /var/run/cups/cups.sock in etc/cups/client.conf (as is suggested here: https://bbs.archlinux.org/viewtopic.php?id=185298) I have no problem printing to the installed printer.

My question is if there is a way to configure both my local printer and to connect to the cups server.

Thank you in advance and best regards,
Tomer

Offline

#2 2015-02-09 23:07:11

paulkerry
Member
From: Sheffield, UK
Registered: 2014-10-02
Posts: 611

Re: Configuring two cups servers

Hi

I use networkmanager and have created a file owned by root in /etc/NetworkManager/dispatcher.d to do this.
This method works if the ip address numeric ranges are different between the two sites.

I called the file /etc/NetworkManager/dispatcher.d/02cupsclient (I already had a file starting with "01") with this content...

#!/bin/sh -e

if [ -z "$1" ]; then
    echo "$0: called with no interface" 1>&2
    exit 1;
fi


case "$2" in
    up)
        rm -f /etc/cups/client.conf
        if [ "`ip addr | grep 192.168.`" ]; then
                ln -sf /etc/cups/client.conf_work /etc/cups/client.conf
        fi
        ;;
    down)
        rm -f /etc/cups/client.conf
        ;;
    *)
        echo "$0: called with unknown action \`$2'" 1>&2
        exit 1
        ;;
esac

change "192.168." in the above to the starting ip address range of your work network and also

chmod 755 /etc/NetworkManager/dispatcher.d/02cupsclient

Also create /etc/cups/client.conf_work with this content...

ServerName {ip address of work cups server}


When network manager detects you are on your work IP address range, then it symbolic links to your custom client.conf file to use your work cups server, otherwise it doesn't link the client.conf leaving you running your own cups system.

Hope this helps.

Cheers
Paul.

Last edited by paulkerry (2015-02-11 10:01:03)

Offline

#3 2015-02-10 14:27:33

shaolintl
Member
From: Paris, France
Registered: 2015-02-09
Posts: 2

Re: Configuring two cups servers

Hi Paul,

Many thanks for your reply.  Your solution works perfectly.

Best regards,
Tomer

Offline

Board footer

Powered by FluxBB