LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-12-2022, 08:43 AM   #1
awaismalik
Member
 
Registered: Mar 2021
Posts: 50

Rep: Reputation: Disabled
cups-lpd running via xinetd


i have installed cups-lpd using dnf install cups-lpd and managing it by xinetd. The files look as follows:

Code:
#cat /etc/xinetd.conf 
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{

# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info


}

includedir /etc/xinetd.d
Code:
#cat /etc/xinetd.d/cups-lpd 

service printer
    {
        socket_type = stream
        protocol = tcp
        wait = no
	flags = IPv4
        user = lp
        server = /usr/lib/cups/daemon/cups-lpd
        server_args = -o document-format=application/octet-stream -o job-sheets=none
    }
and service is running on port 515.
Cups-lpd is being using by an external software. I have to test if cups-lpd is working or not.
I have tried:

Code:
#lp -d PrinterName testpage.txt
The printed page does not contain the expected content but as follows(this information):

Code:
Error Name:    /undefined
Offending Command: cups-lpd
Operand Stack:
Code:
#cups-lpd -h PrinterName testpage.txt
-bash: cups-lpd: Command not found
furthermore i have also stopped xinetd and started and enabled cups-lpd.socket because systemd manages it.
But the result was same

Before printing from the Application how can i test cups-lpd to make sure it is working?
am i doing anything wrongly ?
Following are the mix logs of xinetd and systemd.


Code:
/var/log/messages:348950:May 12 11:12:18 server xinetd[974]: xinetd Version 2.3.15 started with loadavg labeled-networking options compiled in.
/var/log/messages:348951:May 12 11:12:18 server xinetd[974]: Started working: 2 available services
/var/log/messages:356372:May 12 12:22:12 server xinetd[974]: unexpected signal: 18 (Continued) in signal pipe
/var/log/messages:356373:May 12 12:22:12 server xinetd[974]: Exiting...
/var/log/messages:356374:May 12 12:22:12 server systemd[1]: xinetd.service: Succeeded.
/var/log/messages:356378:May 12 12:22:12 server xinetd[20626]: xinetd Version 2.3.15 started with loadavg labeled-networking options compiled in.
/var/log/messages:356379:May 12 12:22:12 server xinetd[20626]: Started working: 2 available services
/var/log/messages:362713:May 12 13:22:21 server xinetd[20626]: unexpected signal: 18 (Continued) in signal pipe
/var/log/messages:362714:May 12 13:22:21 server xinetd[20626]: Exiting...
/var/log/messages:362715:May 12 13:22:21 server systemd[1]: xinetd.service: Succeeded.
/var/log/messages:364380:May 12 13:37:49 server xinetd[40878]: xinetd Version 2.3.15 started with loadavg labeled-networking options compiled in.
/var/log/messages:364381:May 12 13:37:49 server xinetd[40878]: Started working: 2 available services
/var/log/messages:364636:May 12 13:40:02 server xinetd[40878]: unexpected signal: 18 (Continued) in signal pipe
/var/log/messages:364637:May 12 13:40:02 server xinetd[40878]: Exiting...
/var/log/messages:364638:May 12 13:40:02 server systemd[1]: xinetd.service: Succeeded.




Code:
System information:
NAME="AlmaLinux"
VERSION="8.5 (Arctic Sphynx)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.5 (Arctic Sphynx)"

Last edited by awaismalik; 05-13-2022 at 12:21 AM.
 
Old 05-12-2022, 08:48 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,710

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by awaismalik View Post
i have installed cups-lpd using dnf install cups-lpd and managing it by xinetd. The files look as follows:
Code:
#cat /etc/xinetd.conf 
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/
defaults
{

# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info

}

includedir /etc/xinetd.d

#cat /etc/xinetd.d/cups-lpd 

service printer
    {
        socket_type = stream
        protocol = tcp
        wait = no
	flags = IPv4
        user = lp
        server = /usr/lib/cups/daemon/cups-lpd
        server_args = -o document-format=application/octet-stream -o job-sheets=none
    }
and service is running on port 515. Cups-lpd is being using by an external software. I have to test if cups-lpd is working or not. I have tried:
Code:
#lp -d PrinterName testpage.txt
The printed page does not contain the expected content but as follows(this information):
Code:
Error Name:    /undefined
Offending Command: cups-lpd
Operand Stack:

#cups-lpd -h PrinterName testpage.txt
-bash: cups-lpd: Command not found
furthermore i have also stopped xinetd and started and enabled cups-lpd.socket because systemd manages it. But the result was same Before printing from the Application how can i test cups-lpd to make sure it is working? am i doing anything wrongly ? Following are the mix logs of xinetd and systemd.
Code:
/var/log/messages:348950:May 12 11:12:18 server xinetd[974]: xinetd Version 2.3.15 started with loadavg labeled-networking options compiled in.
/var/log/messages:348951:May 12 11:12:18 server xinetd[974]: Started working: 2 available services
/var/log/messages:356372:May 12 12:22:12 server xinetd[974]: unexpected signal: 18 (Continued) in signal pipe
/var/log/messages:356373:May 12 12:22:12 server xinetd[974]: Exiting...
/var/log/messages:356374:May 12 12:22:12 server systemd[1]: xinetd.service: Succeeded.
/var/log/messages:356378:May 12 12:22:12 server xinetd[20626]: xinetd Version 2.3.15 started with loadavg labeled-networking options compiled in.
/var/log/messages:356379:May 12 12:22:12 server xinetd[20626]: Started working: 2 available services
/var/log/messages:362713:May 12 13:22:21 server xinetd[20626]: unexpected signal: 18 (Continued) in signal pipe
/var/log/messages:362714:May 12 13:22:21 server xinetd[20626]: Exiting...
/var/log/messages:362715:May 12 13:22:21 server systemd[1]: xinetd.service: Succeeded.
/var/log/messages:364380:May 12 13:37:49 server xinetd[40878]: xinetd Version 2.3.15 started with loadavg labeled-networking options compiled in.
/var/log/messages:364381:May 12 13:37:49 server xinetd[40878]: Started working: 2 available services
/var/log/messages:364636:May 12 13:40:02 server xinetd[40878]: unexpected signal: 18 (Continued) in signal pipe
/var/log/messages:364637:May 12 13:40:02 server xinetd[40878]: Exiting...
/var/log/messages:364638:May 12 13:40:02 server systemd[1]: xinetd.service: Succeeded.

System information:
NAME="AlmaLinux"
VERSION="8.5 (Arctic Sphynx)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.5 (Arctic Sphynx)"
Again, you need to use CODE tags when posting all of this; it is nearly impossible to read/parse. And is this a continuation of your other CUPS threads, where you ignored most of the advice given to you??
https://www.linuxquestions.org/quest...er-4175711204/
https://www.linuxquestions.org/quest...ps-4175704136/

Since you marked the last thread about your CUPS server as 'Solved', it's odd that you open a new one since you are saying you got it working previously. Start by reading the CUPS documentation about testing things:
http://www.cups.org/doc/options.html
 
1 members found this post helpful.
Old 05-12-2022, 08:59 AM   #3
awaismalik
Member
 
Registered: Mar 2021
Posts: 50

Original Poster
Rep: Reputation: Disabled
Thanks for identation, i will keep in mind to use CODE tags next time. Yes i read the documentation http://www.cups.org/doc/options.html and https://www.cups.org/doc/man-cups-lpd.html which has been mentioned that what i have tried. these command not only gave the expected print out but also i can not see in /var/log that if someone tried to connect to cups-lpd.
 
Old 05-12-2022, 09:09 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,710

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by awaismalik View Post
Thanks for identation, i will keep in mind to use CODE tags next time.
You need to go back in THIS POST and edit it to enclose things in CODE tags.
Quote:
Yes i read the documentation http://www.cups.org/doc/options.html and https://www.cups.org/doc/man-cups-lpd.html which has been mentioned that what i have tried. these command not only gave the expected print out but also i can not see in /var/log that if someone tried to connect to cups-lpd.
You did not mention that you looked at those directions, only the things you tried. And now you're saying that things DID work, but you just can't see things in /var/log? Did you actually set up an accounting file to show what's been/being printed??
http://www.cups.org/doc/accounting.html
https://www.cups.org/doc/man-cupsd-logs.html

/var/log is a directory...what actual FILE are you looking in? And seeing network connections is far different than printer accounting.
 
Old 05-13-2022, 12:45 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,761

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
Either run cups-lpd from xinetd or systemd but not both. I would suggest using systemd.

The easiest way to test the server is to create a raw printer queue that points to a real printer via the cups web page as
lpd://localhost/existing_printer_queue

You can then print something using the regular lpr or lp commands and specify the new print queue. You can test to see if your actually connecting to cups-lpd by stopping it and see what happens.
 
2 members found this post helpful.
Old 05-17-2022, 08:30 AM   #6
awaismalik
Member
 
Registered: Mar 2021
Posts: 50

Original Poster
Rep: Reputation: Disabled
Thanks michaelk. I followed your suggestion and it worked on command line now i will test with the application.But before that i am looking for a log as cups-lpd is being managed by xinetd. This is how the /etc/xinetd looks
Code:
# Define general logging characteristics.
	#log_type	= SYSLOG daemon info 
	log_type	= FILE /var/log/xinetdlog
	log_on_failure	= HOST
	log_on_success	= PID HOST DURATION EXIT
cups-lpd service file look like

Code:
service printer
    {
        socket_type = stream
        protocol = tcp
        wait = no
	flags = IPv4
	log_type = FILE /var/log/xinetdlog
	log_on_success = DURATION EXIT HOST PID USERID
	log_on_failure = ATTEMPT HOST USERID
        user = lp
        server = /usr/lib/cups/daemon/cups-lpd
	server_args = -o document-format=application/octet-stream -o job-sheets=none
    }
But the cat /var/log/xinetdlog is empty. Even after running lp -d PrinterName file.txt three times and have also started xinetd service multiple times.

Have also tried
Code:
grep -rn "cups-lpd" /var/log/
grep -rn "xinetd" /var/log/
But could not find any log info about cups-lpd service.
Do you have an idea where i should look at ?
 
Old 05-17-2022, 09:05 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,761

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
I would not expect anything in the logs as "cups-lpd" since the service name is printer.
 
Old 05-17-2022, 11:28 AM   #8
awaismalik
Member
 
Registered: Mar 2021
Posts: 50

Original Poster
Rep: Reputation: Disabled
i have look around using
Code:
grep -rn "printer" /var/log/
but the result was empty
Here is how the network looks like
Code:
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name     Timer
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      16406/sshd            (0.00/0/0)
tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN      19412/cupsd           (0.00/0/0)
tcp        0      0 0.0.0.0:515             0.0.0.0:*               LISTEN      20263/xinetd          (0.00/0/0)
tcp6       0      0 :::22                   :::*                    LISTEN      16406/sshd            (0.00/0/0)
tcp6       0      0 :::631                  :::*                    LISTEN      19412/cupsd           (0.00/0/0)
still i could not find log file
 
Old 05-17-2022, 11:41 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,761

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
Check your /etc/xinetd.conf maybe it isn't configured to log anything.
 
Old 05-17-2022, 11:47 AM   #10
awaismalik
Member
 
Registered: Mar 2021
Posts: 50

Original Poster
Rep: Reputation: Disabled
this is file

Code:
# cat /etc/xinetd.conf

#
# This is the master xinetd configuration file. Settings in the
# default section will be inherited by all service configurations
# unless explicitly overridden in the service configuration. See
# xinetd.conf in the man pages for a more detailed explanation of
# these attributes.

defaults
{
# The next two items are intended to be a quick access place to
# temporarily enable or disable services.
#
#	enabled		=
#	disabled	=

# Define general logging characteristics.
	#log_type	= SYSLOG daemon info 
	log_type	= FILE /var/log/xinetdlog
	log_on_failure	= HOST
	log_on_success	= PID HOST DURATION EXIT

# Define access restriction defaults
#
#	no_access	=
#	only_from	=
#	max_load	= 0
	cps		= 50 10
	instances	= 50
	per_source	= 10

# Address and networking defaults
#
#	bind		=
#	mdns		= yes
	v6only		= no

# setup environmental attributes
#
#	passenv		=
	groups		= yes
	umask		= 002

# Generally, banners are not used. This sets up their global defaults
#
#	banner		=
#	banner_fail	=
#	banner_success	=
}

includedir /etc/xinetd.d
 
Old 05-17-2022, 12:00 PM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,710

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by awaismalik View Post
this is file

Code:
# cat /etc/xinetd.conf

#
# This is the master xinetd configuration file. Settings in the
# default section will be inherited by all service configurations
# unless explicitly overridden in the service configuration. See
# xinetd.conf in the man pages for a more detailed explanation of
# these attributes.

defaults
{
# The next two items are intended to be a quick access place to
# temporarily enable or disable services.
#
#	enabled		=
#	disabled	=

# Define general logging characteristics.
	#log_type	= SYSLOG daemon info 
	log_type	= FILE /var/log/xinetdlog
	log_on_failure	= HOST
	log_on_success	= PID HOST DURATION EXIT

# Define access restriction defaults
#
#	no_access	=
#	only_from	=
#	max_load	= 0
	cps		= 50 10
	instances	= 50
	per_source	= 10

# Address and networking defaults
#
#	bind		=
#	mdns		= yes
	v6only		= no

# setup environmental attributes
#
#	passenv		=
	groups		= yes
	umask		= 002

# Generally, banners are not used. This sets up their global defaults
#
#	banner		=
#	banner_fail	=
#	banner_success	=
}

includedir /etc/xinetd.d
Great; **AGAIN** did you read the documentation on CUPS??? If you haven't defined the file(s) to use, you aren't going to get anything in them.
http://www.cups.org/doc/man-cups-files.conf.html
 
Old 05-17-2022, 12:45 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,761

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
cups uses the IPP protocol and it makes sense that cups-lpd is an intermediate process that basically talks lpd to the client and then sends the job on to cups itself.

Searching has not found much and I have not personally tested anything yet but to throw out another guess try changing the log file name is the same in both your service and xinetd.conf. Try changing the service file to something else and restart xinetd.
 
Old 05-17-2022, 12:47 PM   #13
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,710

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by michaelk View Post
cups uses the IPP protocol and it makes sense that cups-lpd is an intermediate process that basically talks lpd to the client and then sends the job on to cups itself.

Searching has not found much and I have not personally tested anything yet but to throw out another guess try changing the log file name is the same in both your service and xinetd.conf. Try changing the service file to something else and restart xinetd.
Unless the log files are specified, things aren't going to get logged. Unless you define AccessLog, ErrorLog, PageLog, etc., and define what goes in them, they won't exist. I believe (unknown), that by default it's logged to syslog, so either journalctl or /var/log/messages may have things, but I'm not sure.

http://www.cups.org/doc/man-cups-files.conf.html
 
Old 05-17-2022, 12:57 PM   #14
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,761

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
xinetd is separate from cups and the cups-lpd is separate from the actual cups daemon. xinetd log files are separate from cups log files and unrelated. I would not expect the OP to need to change any cups configuration.
 
Old 05-17-2022, 01:16 PM   #15
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,710

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by michaelk View Post
xinetd is separate from cups and the cups-lpd is separate from the actual cups daemon. xinetd log files are separate from cups log files and unrelated. I would not expect the OP to need to change any cups configuration.
Interesting; would have thought the service itself would have logged the data. In that case, what they're looking for is probably in the system journal.
 
  


Reply

Tags
cups, cups lpd lpr laserjet



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use cups-lpd instead of "lpd" felton57 Red Hat 4 06-13-2008 12:59 PM
Get list of LPD queue names from LPD server? jantman Linux - Hardware 0 02-07-2008 12:21 PM
Printing Problem (cups / cups-lpd) daleman Linux - Software 3 04-08-2005 08:01 AM
Xinetd dead --xinetd dead but pid file exists hillxy Linux - General 1 04-15-2004 02:10 PM
How can I replace Redhat 9 printing via cups with lpd as in RH7 and 8? jhodge Red Hat 3 11-03-2003 05:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration