Why rc-update add <service> is stopped after logging?

I was strugling to get my Canon LBP6000 printer worked with my manjaro-i3-openrc. Now every thing is setted up correctely, and I can print some docs. However, every time, before printeng or getting my printer showed in the printer list, I have start cupsd and ccpdsevices like this:

sudo service cupsd start
sudo service ccpd start

even I added those services using rc-update add cupsd default, after logging and plugin my printer I can not print of see my printer in applications printer list dialog. I checked rc-status and find that those services are STOPPED :triumph: !!!

rc-status
Runlevel: default
 dbus                                                                              [  started  ]
 elogind                                                                           [  started  ]
 NetworkManager                                                                    [  started  ]
 syslog-ng                                                                         [  started  ]
 acpid                                                                             [  started  ]
 sshd                                                                              [  stopped  ]
 netmount                                                                          [  started  ]
 xdm                                                                               [ starting  ]
 alsasound                                                                         [  stopped  ]
 cupsd                                                                             [  stopped  ]
 ccpd                                                                              [  stopped  ]
 cronie                                                                            [  stopped  ]
 ntpd                                                                              [  stopped  ]
 local                                                                             [  stopped  ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed/wanted
 modules-load                                                                      [  started  ]
 xdm-setup                                                                         [  started  ]
Dynamic Runlevel: manual

What the point of adding a service using rc-update add if it do not start automatically when logging or when plug-in the device???

How to correct this?

P.S: I know capt-src does not include a openrc init script. I got this from gentoo package and add it to my /etc/init.d/ and it worked as expected.

It may be you used the wrong start command:

Starting a service
------------------
$ sudo rc-service <service> start

Stopping a service
------------------
$ sudo rc-service <service> stop

I though sudo service and sudo rc-service are equivalent!!!

$ whatis rc-service 
rc-service (8)       - locate and run an OpenRC service with the given arguments
$ whatis service 
service (8)          - locate and run an OpenRC service with the given arguments

Any why Ièll try it and reboot.

You may be right about that. Did you check /var/log/rc.log?

When added with rc-update, there should be an entry for that service in a directory in /etc/runlevels. The cupsd init script is there for me and starts correctly at boot.

Did not work!!! I think i’m missing some thing!!!
I will return to an Arch wiki on how to start pulseaudio when needed…

The rc.log is very long I’ll inspect it later this night!!

ls /etc/runlevels/default/
NetworkManager  alsasound  cgmanager   cronie  dbus     local     ntpd  syslog-ng
acpid           ccpd       consolekit  cupsd   elogind  netmount  sshd  xdm

I think every think is ok… but why service are stopped???

What is the output of

rc-status --all

?

@artoo

here is the rc-status --all output:

Runlevel: boot
 modules                                                                           [  started  ]
 hwclock                                                                           [  started  ]
 fsck                                                                              [  started  ]
 root                                                                              [  started  ]
 mtab                                                                              [  started  ]
 swap                                                                              [  started  ]
 localmount                                                                        [  started  ]
 procfs                                                                            [  started  ]
 binfmt                                                                            [  started  ]
 sysctl                                                                            [  started  ]
 bootmisc                                                                          [  started  ]
 termencoding                                                                      [  started  ]
 urandom                                                                           [  started  ]
 loopback                                                                          [  started  ]
 hostname                                                                          [  started  ]
 net.lo                                                                            [  started  ]
 keymaps                                                                           [  started  ]
Runlevel: default
 dbus                                                                              [  started  ]
 elogind                                                                           [  started  ]
 NetworkManager                                                                    [  started  ]
 syslog-ng                                                                         [  started  ]
 acpid                                                                             [  started  ]
 sshd                                                                              [  stopped  ]
 netmount                                                                          [  started  ]
 xdm                                                                               [ starting  ]
 alsasound                                                                         [  stopped  ]
 cupsd                                                                             [  stopped  ]
 ccpd                                                                              [  stopped  ]
 cronie                                                                            [  stopped  ]
 ntpd                                                                              [  stopped  ]
 local                                                                             [  stopped  ]
Runlevel: sysinit
 devfs                                                                             [  started  ]
 kmod-static-nodes                                                                 [  started  ]
 sysfs                                                                             [  started  ]
 udev                                                                              [  started  ]
 dmesg                                                                             [  started  ]
 udev-trigger                                                                      [  started  ]
Runlevel: nonetwork
 local                                                                             [  stopped  ]
Runlevel: shutdown
 savecache                                                                         [  stopped  ]
 killprocs                                                                         [  stopped  ]
 mount-ro                                                                          [  stopped  ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed/wanted
 modules-load                                                                      [  started  ]
 xdm-setup                                                                         [  started  ]
Dynamic Runlevel: manual

Something wrong with your xdm service.

What display manager do you use?

I use slim

here is the slim.conf

/etc/slim.conf
# Path, X server and arguments (if needed)
# Note: -xauth $authfile is automatically appended
default_path        /bin:/usr/bin:/usr/local/bin
default_xserver     /usr/bin/X
xserver_arguments -nolisten tcp vt07

# Commands for halt, login, etc.
halt_cmd            /sbin/shutdown -h now
reboot_cmd          /sbin/shutdown -r now
console_cmd         /usr/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login"
#suspend_cmd        /usr/sbin/suspend

# Full path to the xauth binary
xauth_path         /usr/bin/xauth 

# Xauth file for server
authfile           /var/run/slim.auth


# Activate numlock when slim starts. Valid values: on|off
numlock             on

# Hide the mouse cursor (note: does not work with some WMs).
# Valid values: true|false
# hidecursor          false

# This command is executed after a succesful login.
# you can place the %session and %theme variables
# to handle launching of specific commands in .xinitrc
# depending of chosen session and slim theme
#
# NOTE: if your system does not have bash you need
# to adjust the command according to your preferred shell,
# i.e. for freebsd use:
#login_cmd           exec /bin/sh - ~/.xinitrc %session
login_cmd           exec /bin/bash -login ~/.xinitrc %session
#login_cmd           exec ck-launch-session dbus-launch /bin/bash -login ~/.xinitrc %session 

# Commands executed when starting and exiting a session.
# They can be used for registering a X11 session with
# sessreg. You can use the %user variable
#
# sessionstart_cmd	some command
# sessionstop_cmd	some command

# Start in daemon mode. Valid values: yes | no
# Note that this can be overriden by the command line
# options "-d" and "-nodaemon"
# daemon	yes

# Set directory that contains the xsessions.
# slim reads xsesion from this directory, and be able to select.
sessiondir            /usr/share/xsessions/

# Executed when pressing F11 (requires imagemagick)
screenshot_cmd      import -window root /slim.png

# welcome message. Available variables: %host, %domain
welcome_msg         Welcome to %host

# Session message. Prepended to the session name when pressing F1
# session_msg         Session: 

# shutdown / reboot messages
shutdown_msg       The system is halting...
reboot_msg         The system is rebooting...

# default user, leave blank or remove this line
# for avoid pre-loading the username.
#default_user       kbk 

# Focus the password field on start when default_user is set
# Set to "yes" to enable this feature
#focus_password      yes

# Automatically login the default user (without entering
# the password. Set to "yes" to enable this feature
#auto_login          no


# current theme, use comma separated list to specify a set to 
# randomly choose from
current_theme       archlinux,default

# Lock file
lockfile            /var/lock/slim.lock

# Log file
logfile             /var/log/slim.log
~/.xinitrc
#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then

    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then

    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

# sart udiskie
udiskie --no-automount --no-notify --tray --use-udisks2 &

# .Xresources
[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources

# fonts
xset +fp /usr/share/fonts/local
xset fp rehash

# sessions: DE and WM
session=${1:-i3}
case $session in
	i3|i3wm		) exec i3;;
	*) exec $1;;
esac

No idea with slim,

You may need to adapt your /etc/pam.d/slim is there is any.

Also, did you adapt /etc/conf.d/xdm to point to slim?

“cupsd” does not work without “avahi” which will auto start from cups and will appear as an “avahi-daemon”

@artoo yes, xdm is pointing to slim.
I installed manjaro and in december using OpenRC Net edition, and every thing is went fine.

@robinw0800 I will try it and reboot. I added it sudo rc-update avahi-daemon default. I hope it will work!

No don’t add it just make sure its installed

It was installed from the begining, and after I add it and reboot nothing happened.
I think ome udev rules should write be written to start those services on an event (printer plug-in) … but I do not know how to do it!

Mine is only in needed/wanted as avahi-daemon which you can’t add it to and as I said has to be called by cupsd

Still struggling to find a solution!!!

Change DM, try with lightdm for example. slim is knon to be troublesome iirc.

Thank you for the replay.
I do not want to change my DM. Currently, I prefer to manually start cupsd and ccpd than switching to an other DM. SLiM is minimal, very light and easy. I had experienced some troubles with other DMs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.