View Full Version : Start services before login
Cake
30th May 2009, 11:27 AM
I can view my website, and ssh in when I've logged in already at home, but if the system gets rebooted, and gets as far as the login screen, I am not able to view the web site or ssh in. I was wondering how to set things up so that these services are running independent of logging in. Thanks in advance!
willyb1946
30th May 2009, 07:29 PM
I don't think this is possible, but I could be wrong.
That being said, the most logical way to solve this is to set up automatic login so that if your server reboots, it will end up back where it started. Unfortunately, there is currently no graphical front end for doing this. It used to be done through 'gdmsetup' but this has been broken since FC9.
Not to panic, however. There is a way to do it by manually changing file /etc/gdm/custom.conf. It is described in the following thread. I tried it and it works.
http://www.gossamer-threads.com/lists/mythtv/users/337909
neogranas
30th May 2009, 07:53 PM
Do you have those services turned on in chkconfig for lower run levels like 2, 3, and 5? Those shouldn't require a login at the machine and it should start the services.
Cake
30th May 2009, 11:50 PM
Do you have those services turned on in chkconfig for lower run levels like 2, 3, and 5? Those shouldn't require a login at the machine and it should start the services.
Yes, I do have them running on lower run levels.
beaker_
31st May 2009, 12:02 AM
paste the output of the following 4 commands.
chkconfig --list httpd
chkconfig --list sshd
chkconfig --list network
cat /etc/sysconfig/network-scripts/ifcfg-eth0
Cake
31st May 2009, 12:23 AM
[Cake@MixingBowl ~]# chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[Cake@MixingBowl ~]# chkconfig --list sshd
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[Cake@MixingBowl ~]# chkconfig --list network
network 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[Cake@MixingBowl ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:c0:9f:db:82:8f
ONBOOT=yes
DHCP_HOSTNAME=localhost.localdomain
NM_CONTROLLED=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=yes
IPV6INIT=no
DNS2=68.87.69.146
DNS3=68.87.78.130
DNS1=68.87.85.98
beaker_
31st May 2009, 12:33 AM
your network device is controlled by network manager. It won't be activated before you login.
At the terminal:
su
system-config-network
- Uncheck "controlled by network manager", and "check activate device on startup." Yeah don't forget your network configuration... dhcp or static....
chkconfig --level 2345 network on
- Don't worry about stopping network manager, it's still good for wireless. Also firefox will start offline until you tell it to stop looking at network manager to determine it's presence.
service network restart
Edit: I forgot to say, restart the machine. That way you know everything will work as expect.
stevea
31st May 2009, 01:35 AM
Beaker cracked the code - your enet *may* not come up using Networkmanager and certainly won't come up on a wifi. NM isn't appropriate for server use (yet).
Cake
31st May 2009, 02:32 AM
Doesn't seem that the devices work without Network Manager...
stevea
31st May 2009, 02:43 AM
During startup (if you type a character to break out of plymouth) you should see the attempt for network services to start, and also see if it fails.
You can use the "ifup eth0" and "ifdown eth0" whic does approximately the same think and starting/stopping network services.
Something is wrong with your network configs.
Cake
31st May 2009, 03:55 AM
Ok, httpd is working, but ssh is still kinda pooping on itself unless I'm logged into runlevel 5, even though it says it runs in runlevel 3. It's not really useful unless I can log in remotely and change things if necessary.
Cake
31st May 2009, 04:04 AM
Oops. Nevermind about httpd working. Musta left some cookies er sumsuch.
beaker_
31st May 2009, 04:47 AM
So are you saying you're back at post 1? How are you managing your firewall?
If so, at the terminal, paste the output from these commands:
su
chkconfig --list httpd
chkconfig --list sshd
chkconfig --list network
service httpd status
service httpd restart
service sshd status
service sshd restart
service network status
service network restart
ifconfig
cat /etc/sysconfig/network-scripts/ifcfg-eth0
cat /etc/sysconfig/iptables
Cake
31st May 2009, 05:25 AM
Yeah, still at square one. Though it seemed like I did more, since newly updated nvidia drivers broke X and I got to play another elimination game of what's broken. I manage the firewall by going to System > Administration > Firewall. I have ports 22, 80, and 5900-5902 open. I have eth0 as a trusted interface, I have save on stop, save on restart, and save on restore marked.
[Cake@MixingBowl ~]$ su -
Password:
[root@MixingBowl ~]# chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@MixingBowl ~]# chkconfig --list sshd
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@MixingBowl ~]# chkconfig --list network
network 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@MixingBowl ~]# service httpd status
httpd (pid 1662 1661 1660 1659 1658 1657 1656 1655 1618) is running...
[root@MixingBowl ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@MixingBowl ~]# service sshd status
openssh-daemon (pid 1561) is running...
[root@MixingBowl ~]# service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
[root@MixingBowl ~]# service network status
Configured devices:
lo eth0 wlan0
Currently active devices:
lo wmaster0 wlan0
[root@MixingBowl ~]# service network restart
Shutting down interface wlan0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@MixingBowl ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:c0:9f:db:82:8f
ONBOOT=yes
DHCP_HOSTNAME=localhost.localdomain
NM_CONTROLLED=no
TYPE=Ethernet
USERCTL=no
PEERDNS=yes
IPV6INIT=no
DNS2=68.87.69.146
DNS3=68.87.78.130
DNS1=68.87.85.98
beaker_
31st May 2009, 11:20 AM
eth0 may no longer be controlled by network manager, good, but network service is off.
At the terminal:
su
chkconfig --level 2345 network on
reboot
We're assuming you connect with your ethernet card, not your wifi.
willyb1946
31st May 2009, 06:06 PM
I could be wrong, but all this hassle could probably be avoided by simply implementing autologon as per my post 2. :D
beaker_
31st May 2009, 07:16 PM
Perhaps but then you're educating people that it's ok for their server's NICs to be controlled in user-space (I hope that's the correct term) which... well... I'm baised. On my sites, I'd personally beat them with a shovel then introduce them my Megger.
Cake
31st May 2009, 07:39 PM
Turning runlevels on network was the trick! Network Manager kept trying to control eth0. I went into services and turned it off AND disabled it. It's all squishy now. Woo! Thanks, beaker!
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.