I have a problem.
The goal is to boot the computer and have the services I need for printing already running at boot and I just go to the printer selector and select my network printer.
I installed the latest kali-rolling version and have a HP printer I'm working with.
Once kali-rolling was installed I ran update in terminal.
After installation there is no printer programs or drivers installed.
I installed cups cups-client and foomatic.db.
when I boot kali I always have to run terminal /etc/init.d/cups start to get cups running.
After doing the above and after reading some posts on the problem I checked a few things in /etc/init.d folder and it appears the few scripts such as (cups samba smbd) I'll post the output of cups and samba at the very bottom of this post.
moving on..
When I do the following which is an excerpt from someone elses post:
4. Open terminal and type:
/etc/init.d/cups start
you got this:
[ ok ] Starting Common Unix Printing System: cupsd.
5. In terminal type:
netstat -ant | grep 631
you got this:
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp6 0 0 ::1:631 :::* LISTEN
tcp6 0 0 ::1:39723 ::1:631 ESTABLISHED
tcp6 0 0 ::1:39722 ::1:631 ESTABLISHED
tcp6 0 0 ::1:631 ::1:39723 ESTABLISHED
tcp6 0 0 ::1:39721 ::1:631 ESTABLISHED
tcp6 0 0 ::1:631 ::1:39721 ESTABLISHED
tcp6 0 0 ::1:39720 ::1:631 ESTABLISHED
tcp6 0 0 ::1:39724 ::1:631 TIME_WAIT
tcp6 0 0 ::1:631 ::1:39722 ESTABLISHED
tcp6 0 0 ::1:631 ::1:39720 ESTABLISHED
Continuing I don't get the above but I get this output instead:
/etc/cups/cups start
starting cups (via systemctl): cups.service.
netstat -ant | grep 631
tcp 0 0 0.0.0.1:631 0.0.0.0:* LISTEN
tcp6 0 0 ::1:631 :::* LISTEN
tcp6 0 0 ::1:631 ::1:47612 ESTABLISHED
tcp6 0 0 ::1:631 ::1:631 ESTABLISHED
and when I type lsusb
I don't see my printer but I see other drivers
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
however after manualy starting cups I can print and in cups the printer connection is socket.
I also cannot find any kind of printer in system or administration.
only on the cups page 127.0.0.1:631
It would be nice to be able to go to system and configure a printer through gnome but there is no option.
Do you see any suspects I can check to try and get things straightened out?
I've hammered at this for days
**************************************
As I stated at the very top of this post
I'm posting the /etc/init.d/cups && samba scripts below.
Cups
#! /bin/sh
### BEGIN INIT INFO
# Provides: cups
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $network avahi-daemon slapd nslcd
# Should-Stop: $network
# X-Start-Before: samba
# X-Stop-After: samba
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: CUPS Printing spooler and server
# Description: Manage the CUPS Printing spooler and server;
# make it's web interface accessible on http://localhost:631/
### END INIT INFO
# Author: Debian Printing Team <[email protected]>
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/cupsd
NAME=cupsd
PIDFILE=/var/run/cups/$NAME.pid
DESC="Common Unix Printing System"
SCRIPTNAME=/etc/init.d/cups
unset TMPDIR
# Exit if the package is not installed
test -x $DAEMON || exit 0
mkdir -p /var/run/cups/certs
[ -x /sbin/restorecon ] && /sbin/restorecon -R /var/run/cups
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
# Get the timezone set.
if [ -z "$TZ" -a -e /etc/timezone ]; then
TZ=`cat /etc/timezone`
export TZ
fi
coldplug_usb_printers() {
if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then
for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \
--attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \
udevadm trigger --verbose --dry-run --subsystem-match=usb \
--sysname-match='lp[0-9]*' 2>/dev/null || true`; do
/lib/udev/udev-configure-printer add "${printer#/sys}"
done
fi
}
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
mkdir -p `dirname "$PIDFILE"`
start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" --exec $DAEMON
status=$?
[ $status = 0 ] && coldplug_usb_printers
log_end_msg $status
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --quiet --retry 5 --oknodo --pidfile $PIDFILE --name $NAME
status=$?
log_end_msg $status
;;
reload|force-reload)
log_daemon_msg "Reloading $DESC" "$NAME"
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME --signal 1
status=$?
log_end_msg $status
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
if start-stop-daemon --stop --quiet --retry 5 --oknodo --pidfile $PIDFILE --name $NAME; then
start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec $DAEMON
fi
status=$?
log_end_msg $status
;;
status)
status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
exit 3
;;
esac
exit 0
-------------------------------------------------------
samba
#!/bin/sh
### BEGIN INIT INFO
# Provides: samba
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: ensure Samba daemons are started (nmbd, smbd and samba)
# Description: Starts Samba, a Windows AD and SMB/CIFS fileserver for UNIX
### END INIT INFO
set -e
# start nmbd, smbd and samba-ad-dc unconditionally
# the init scripts themselves check if they are needed or not
case $1 in
start)
/etc/init.d/nmbd start
/etc/init.d/smbd start
/etc/init.d/samba-ad-dc start
;;
stop)
/etc/init.d/samba-ad-dc stop
/etc/init.d/smbd stop
/etc/init.d/nmbd stop
;;
reload)
/etc/init.d/smbd reload
;;
restart|force-reload)
/etc/init.d/nmbd "$1"
/etc/init.d/smbd "$1"
/etc/init.d/samba-ad-dc "$1"
;;
status)
status=0
NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null || true`
SERVER_ROLE=`samba-tool testparm --parameter-name="server role" 2>/dev/null | tail -1 || true`
if [ "$SERVER_ROLE" != "active directory domain controller" ]; then
if [ "$NMBD_DISABLED" != "Yes" ]; then
/etc/init.d/nmbd status || status=$?
fi
/etc/init.d/smbd status || status=$?
else
/etc/init.d/samba-ad-dc status || status=$?
fi
exit $status
;;
*)
echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}"
exit 1
;;
esac
------------------------------------------------
smbd
#!/bin/sh
### BEGIN INIT INFO
# Provides: smbd
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Should-Start: slapd cups
# Should-Stop: slapd cups
# Short-Description: Samba SMB/CIFS daemon (smbd)
# Description: server to provide SMB/CIFS services to clients
### END INIT INFO
PIDDIR=/var/run/samba
SMBDPID=$PIDDIR/smbd.pid
# clear conflicting settings from the environment
unset TMPDIR
# See if the daemons are there
test -x /usr/sbin/smbd || exit 0
. /lib/lsb/init-functions
case $1 in
start)
if init_is_upstart; then
exit 1
fi
SERVER_ROLE=`samba-tool testparm --parameter-name="server role" 2>/dev/null | tail -1`
if [ "$SERVER_ROLE" = "active directory domain controller" ]; then
exit 0
fi
log_daemon_msg "Starting SMB/CIFS daemon" smbd
# Make sure we have our PIDDIR, even if it's on a tmpfs
install -o root -g root -m 755 -d $PIDDIR
if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/smbd -- -D; then
log_end_msg 1
exit 1
fi
log_end_msg 0
;;
stop)
if init_is_upstart; then
exit 0
fi
log_daemon_msg "Stopping SMB/CIFS daemon" smbd
start-stop-daemon --stop --quiet --pidfile $SMBDPID
# Wait a little and remove stale PID file
sleep 1
if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
then
# Stale PID file, remove it (should be removed by
# smbd itself IMHO).
rm -f $SMBDPID
fi
log_end_msg 0
;;
reload)
log_daemon_msg "Reloading /etc/samba/smb.conf" smbd
start-stop-daemon --stop --quiet --signal HUP --pidfile $SMBDPID
log_end_msg 0
;;
restart|force-reload)
if init_is_upstart; then
exit 1
fi
$0 stop
sleep 1
$0 start
;;
status)
status_of_proc -p $SMBDPID /usr/sbin/smbd smbd
exit $?
;;
*)
echo "Usage: /etc/init.d/smbd {start|stop|reload|restart|force-reload|status}"
exit 1
;;
esac
----------------------------