Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Service was in default runlevel but didn't start
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6308
Location: /usr/lib64/lv2

PostPosted: Fri Sep 29, 2017 7:31 pm    Post subject: Service was in default runlevel but didn't start Reply with quote

According to uptime, my server has been up for 18 hours, explaining why I haven't been getting mails via postfix/dovecot. But despite those two services being in my default runlevel, they were apparently not started when my server rebooted. (It's a hosted dedicated, it wasn't me that rebooted it, otherwise I would have checked for this stuff as part of my bootup check.)

Why would a service not be running if it's in the default runlevel?
_________________
Gentoo Studio: A Gentoo-based, professional digital audio workstation OS.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42592
Location: 56N 3W

PostPosted: Fri Sep 29, 2017 8:00 pm    Post subject: Reply with quote

audiodef,

It failed to start for some reason, or something it depends on failed to start.

Poke around in /run/openrc/* and see what you find.

Try starting the services manually. That may give useful information.
Stop the services Then start them. Any errors on the command line, dmesg or the service log files (if they have them)?

Lastly, ensure the services are stopped, stop and zap them if you are not sure.
Run the services in the foreground (see the man pages) any problems will be reported in the console.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6308
Location: /usr/lib64/lv2

PostPosted: Fri Sep 29, 2017 10:49 pm    Post subject: Reply with quote

Thanks, Neddy.

I suspect it's related to my having given apache a password. It cannot be (re)started without it, and since postfix references my apache-managed domain, that probably caused my mail server to not start.

So, the question I was originally going to post: what's a good way to set up a cron job that monitors apache/postfix/dovecot and mails me if any of them are not running?
_________________
Gentoo Studio: A Gentoo-based, professional digital audio workstation OS.
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Sat Sep 30, 2017 9:50 am    Post subject: Reply with quote

How about:
Code:
service postfix status || send_me_a_message_via_a_seer_for_email_is_broken

Service status does report using both, standard output AND error code, and the latter is easily used in scripts.
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6308
Location: /usr/lib64/lv2

PostPosted: Mon Oct 02, 2017 7:28 pm    Post subject: Reply with quote

Thanks, szatox. 8)
_________________
Gentoo Studio: A Gentoo-based, professional digital audio workstation OS.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum