LinuxQuestions.org
Visit Jeremy's Blog.
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 03-01-2016, 01:19 PM   #1
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 493

Rep: Reputation: 223Reputation: 223Reputation: 223
[Solved] ssh, cron, etc not starting at boot anymore


Using OpenVZ Debian 7 with Upstart.
ssh, cron and other services don't start at boot now.

My problem seems very similar to this unresolved issue.
https://www.linuxquestions.org/quest...nymore-780037/

I can start them manually
Code:
sudo service ssh start
sudo service cron start
ssh (and cron) is correctly linked in
Code:
$ ls -l /etc/rc*.d/* |grep 'init.d/ssh'
lrwxrwxrwx 1 root root  13 Feb 25 13:33 /etc/rc2.d/S02ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root  13 Feb 25 13:33 /etc/rc3.d/S02ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root  13 Feb 25 13:33 /etc/rc4.d/S02ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root  13 Feb 25 13:33 /etc/rc5.d/S02ssh -> ../init.d/ssh
Unknown runlevel but I can set it. After rebooting it resets to unknown.

Code:
$ runlevel
unknown
$ init 2
$ runlevel
N 2
I have /etc/init/rc.conf and /etc/init/rc-sysinit.conf files -> http://pastebin.com/nQhjiX9J

Last edited by Sefyir; 03-14-2016 at 11:36 AM.
 
Old 03-01-2016, 05:24 PM   #2
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 16
Posts: 5,266

Rep: Reputation: Disabled
If that distro uses upstart it may have a run level set by
/etc/init/rc-sysinit.conf

also if you use grub2 you can set the run level by appending the run level number to your kernel like
eg 3 (0r) 5
 
Old 03-01-2016, 05:30 PM   #3
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 493

Original Poster
Rep: Reputation: 223Reputation: 223Reputation: 223
Quote:
Originally Posted by aus9 View Post
If that distro uses upstart it may have a run level set by
/etc/init/rc-sysinit.conf

also if you use grub2 you can set the run level by appending the run level number to your kernel like
eg 3 (0r) 5
I have my rc-sysinit.conf displayed already (line 24)
I'm suspecting the rc-sysinit.conf file is not even being run.

Since I am using a OpenVZ container, I don't believe I have access to my kernel like that (this is with a VPS using a Solus image)

Last edited by Sefyir; 03-01-2016 at 05:31 PM.
 
Old 03-02-2016, 01:38 AM   #4
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 16
Posts: 5,266

Rep: Reputation: Disabled
there should be a command you can run that shows what is running or what is now stopped and run at boot.

altho you are debian this link may help?
http://askubuntu.com/questions/19320...sable-services
 
Old 03-02-2016, 07:37 AM   #5
JoseKreif
Member
 
Registered: Jul 2015
Location: Iowa
Distribution: CentOS 6.6, RHEL Server release 5.5 (Tikanga)
Posts: 57

Rep: Reputation: 0
I'm a little nooby with the administration side of Linux, yet. But I had to do this to get my VNC servers to start on their own

chkconfig vncserver on

try

# -> chkconfig ssh on
# -> chkconfig cron on
 
Old 03-02-2016, 10:48 AM   #6
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 493

Original Poster
Rep: Reputation: 223Reputation: 223Reputation: 223
Quote:
Originally Posted by JoseKreif View Post
I'm a little nooby with the administration side of Linux, yet. But I had to do this to get my VNC servers to start on their own

chkconfig vncserver on

try

# -> chkconfig ssh on
# -> chkconfig cron on
They're already enabled according to chkconfig. Output of my chkconfig
http://pastebin.com/yDyDidMP

Quote:
there should be a command you can run that shows what is running or what is now stopped and run at boot.
I thought it was chkconfig and having files linked in /etc/rcX.d/. For example, my ssh process is linked into the rc2-5 run levels.
So it should be starting, but for whatever reason it's not. per the link, I can start processes (albeit temporarily with service start process). The override file didn't work however.. The upstart commands (like status, start, stop) seemed to have no effect.
 
Old 03-02-2016, 05:25 PM   #7
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 16
Posts: 5,266

Rep: Reputation: Disabled
well lets confirm you are using upstart or something else like systemd then?

post the output of
Code:
ls -al /sbin/init
 
Old 03-02-2016, 05:57 PM   #8
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 493

Original Poster
Rep: Reputation: 223Reputation: 223Reputation: 223
Quote:
Originally Posted by aus9 View Post
well lets confirm you are using upstart or something else like systemd then?

post the output of
Code:
ls -al /sbin/init
Sure

Code:
-rwxr-xr-x 1 root root 224568 Dec 10  2012 /sbin/init
That didn't seem to give relevant info so I did this:

Code:
$ /sbin/init --version
init (upstart 1.6.1)
Copyright (C) 2012 Scott James Remnant, Canonical Ltd.

Last edited by Sefyir; 03-02-2016 at 06:00 PM.
 
Old 03-03-2016, 12:12 PM   #9
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 493

Original Poster
Rep: Reputation: 223Reputation: 223Reputation: 223
On reboot, I have to use a serial console (since sshd doesn't start)
If I run as root

Code:
init 2
everything loads up fine like normal (ssh, cron, etc)
 
Old 03-03-2016, 06:35 PM   #10
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 16
Posts: 5,266

Rep: Reputation: Disabled
me thinks there is something not quite right about your last output as for me I get

ls -al /sbin/init
lrwxrwxrwx 1 root root 20 Feb 17 13:47 /sbin/init -> /lib/systemd/systemd

so I was expecting to see upstart as a sym link....unless you deliberately culled it?
 
Old 03-03-2016, 11:39 PM   #11
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 493

Original Poster
Rep: Reputation: 223Reputation: 223Reputation: 223
Quote:
Originally Posted by aus9 View Post
me thinks there is something not quite right about your last output as for me I get

ls -al /sbin/init
lrwxrwxrwx 1 root root 20 Feb 17 13:47 /sbin/init -> /lib/systemd/systemd

so I was expecting to see upstart as a sym link....unless you deliberately culled it?
I didn't do anything
I have a functioning debian 7 VPS openvz like the main one. Checking that gave the same result.

Just to be sure, I ran file on it as well (same output as the functioning one)

Code:
/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xf4c005815c16bce9ce0fb5cfcf79d595ff3e8bdc, stripped
 
Old 03-08-2016, 11:55 AM   #12
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 493

Original Poster
Rep: Reputation: 223Reputation: 223Reputation: 223
bump. (still not resolved)
 
Old 03-09-2016, 05:43 PM   #13
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 16
Posts: 5,266

Rep: Reputation: Disabled
hmm well lets try something else?

Code:
dpkg -S /sbin/init
I get a systemd response but you will get a certain package not called systemd-sysv maybe upstart-sysv

then force it to reload/reconfig with root powers pls

Code:
dpkg-reconfigure upstart-sysv
assuming I have the correct package name.

full reboot to test....if that fails then have a gander at
https://wiki.ubuntu.com/SystemdForUpstartUsers

https://www.maketecheasier.com/re-en...pstart-ubuntu/

you will notice there is mention of sudo update-initramfs -u and that may well be want you need?
 
Old 03-10-2016, 10:18 AM   #14
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 493

Original Poster
Rep: Reputation: 223Reputation: 223Reputation: 223
Hmm.. no dice

Code:
#$ dpkg -S /sbin/init
upstart: /sbin/init
#$ dpkg -S upstart-sysv
dpkg-query: no path found matching pattern *upstart-sysv*
#$ dpkg-reconfigure upstart-sysv
dpkg-query: package 'upstart-sysv' is not installed and no information is available
Code:
sudo update-initramfs -u
seemed to have no effect. I am running on a OpenVZ container so I may not have access to that.
I believe that the .conf scripts are being run however since removing them (from /etc/init) caused a lot of issues on the next bootup!

For some reason however, the ones I want aren't (dealing with files in /etc/init.d/rc*.d). I'd love to see the debug log for what's going on but I'm not aware of where to look for this one. /var/log/upstart/* did not contain any relevant info..
 
Old 03-10-2016, 05:43 PM   #15
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 16
Posts: 5,266

Rep: Reputation: Disabled
well you did not understand the result of the first command?

I was expecting upstart-sysv but your claim was upstart so now try as root

dpkg-reconfigure upstart

but you are not doing it as root either?

if you are root....symbol is # not #$

try

Code:
sudo su
dpkg-reconfigure upstart
##########################################

if sudo su does nothing try replacing it with su

########################################

I have no experience in OpenVZ containers so this probably will be my last attempt to help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Preventing ssh service from starting at boot moxieman99 Ubuntu 1 09-22-2010 09:29 PM
[SOLVED] udevd not starting anymore m-h Linux - General 5 07-09-2010 02:10 AM
Proftpd, ssh, webmin not starting at startup anymore black669 Linux - Software 16 01-06-2010 02:31 AM
starting SSH as a service during boot Flappie_Snappie Linux - Newbie 4 10-06-2006 06:15 PM
Starting SSH Reverse tunnelling at boot BU5T4 Linux - Software 2 11-18-2003 03:33 PM

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

All times are GMT -5. The time now is 08:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration