I’ve got CUPS working so I can use my RPiB as a print server.
All working fine until I restart the Pi. I am then unable to access 192.168.1.4:631/admin - CUPS does not seem to be starting when the Pi boots. As soon as I start CUPS manually I can access the admin page.
Had a quick browse at that thread but it talks about upstart and also uses /etc/if-up.d/ scripts - we have neither of those in OSMC.
We use systemd not upstart for the init system, and if-up.d scripts are not currently supported. (But may be added in the future - it’s something we’re looking into)
The best way to start services under systemd is to use a native systemd service unit, but most legacy /etc/init.d/ scripts are supported as well through systemd’s backward compatibility layer. Debian packages seem to use a mixture of the two approaches at the moment as many packages still don’t have systemd scripts even though systemd is standard in Debian Jessie.
Do you know what the service name is ? Assuming it is cups, what does this say:
I suspected it had something to do with the newer filesystem. As a non Linux person I’m fumbling through this as best I can with what I can find online via various forums. I’m surprised I got it going in the first place and as far as this.
The service name is definitely “cups”.
If I SSH in and run
sudo service cups restart
It starts the cups service again.
I just stuffed something up and had to do a fresh install from a backup. I’ll install CUPS again and run:
the service command is deprecated on a systemd system. You would want to use systemctl:
sudo systemctl restart cups
(restarts the service)
sudo systemctl enable cups
(sets it to start on boot)
Familiarise yourself with the start, stop, restart, enable, disable and status options of systemctl on the following page - they are the ones you’d most frequently use when configuring and testing services:
Looks like it is a proper systemd service - have a look at that file and you’ll see the way the service is configured to start.
systemd works very differently to previous init systems so for people like me used to older init systems it takes a bit of time to wrap your head around it, but there is a lot to like about it once you get comfortable with it.
A systemd service unit can be written in a couple of minutes when you’re familiar with it - not so for a legacy /etc/init.d/ script that is full of complicated boilerplate code
systemctl status cups, from memory was saying disabled. That doesn’t mean that it won’t start on demand though…I guess.
I was basing my decision that it wasn’t working on accessing the admin page for CUPS on 192.168.1.4:631. When the service isn’t running it is not possible to access the admin page. When I restarted CUPS the admin page was accessible…obviously.
I’ll see what happens when I do some testing tonight or tomorrow.
Interesting, I wonder if it was this change that “fixed” it:
We discovered a problem with the service dependencies for connman (our network manager) that was causing problems with the ordering of dbus and connman services during startup and shutdown.
The symptom I first noticed is that during shutdown/reboot services that state they need network were not being shut down before connman - thus they would lose their network connection before shutting down. (Normally all network requiring services should shut down before the network is taken down so they can finish up what they are doing)
The changes to fix shutdown ordering will also have changed startup ordering (as they are just mirror images) so it could well have affected your cups problem. (Most likely cups was trying to start before connman before but will now be starting after it)
I was getting something like a kernel panic on startup. The startup OSMC screen had a whole heap of writing scrolling down the screen before startup. This has now stopped.
Thanks for your insight into this “issue”. I tried everything I could with my limited knowledge and dealing with outdated info in other forums.
Another reason for boot messages to appear is if there are any unusual delays for services starting up during boot - what counts as “unusual” varies depending on whether other services are being held up by the delayed service or not - if they are, typically it will show a message saying that it is waiting for a service to start after about 10 seconds of the service starting up but still not having finished starting.
With some older legacy init scripts it’s difficult to completely avoid getting such messages saying that it is waiting for a service to start. If you could take a picture of the screen at the instant that text begins to appear over the splash we could probably work out the cause, but there might not be a way to prevent it.
A stock OSMC install doesn’t display any boot time text so it probably is related to cups, or possibly samba if you have that installed.