System doesn't see rc.conf

I met strange error when was triyng to restart apache22 on FreeBSD 9 -

Code:
Cannot 'start' apache. Set apache enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'
/etc/rc.conf exists and apache22 already enabled. And then I tried to restart postgresql same warning -

Code:
/usr/local/etc/rc.d/postgresql start
Cannot 'start' postgresql. Set postgresql_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.

It looks like system can't read rc.conf. Permissions set to 644.

I'm very confused seems like simple error, but not so obvious for me.
 
Post your rc.conf.

Or run it manually through sh(1) with the -x option:
# sh -x /usr/local/etc/rc.d/apache22 start

And, check the output of the rcvar option:
# service apache22 rcvar
 
This can happen, if your line endings are not typical for Unix. Load the file into vim, type:
Code:
:set fileformat=unix
:wq
 
Demontager said:
I met strange error when was triyng to restart apache2 on FreeBSD 9 -

Code:
Cannot 'start' apache. Set apache enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'
/etc/rc.conf exists and apache22 already enabled. And then i tried to restart postgresql same warning -

Code:
/usr/local/etc/rc.d/postgresql start
Cannot 'start' postgresql. Set postgresql_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.

It looks like system can't read rc.conf. Permissions set to 644.

I'm very confused seems like simple error, but not so obvious for me.

Is your routing adresses set up in your httpd.conf and pg_hba.conf
 
rc.conf
Code:
hostname="myserver.com"
sshd_enable="YES"
sendmail_enable="NONE"
zfs_enable="YES"
#ntpd_enable="YES"
ifconfig_re0="inet 78.47.xxx.xxx netmask 255.255.255.240"
defaultrouter="78.47.xxx.xxx"
apache22_enable="YES"
nginx_enable="YES"
mysql_enable="YES"
#memcached_enable="YES"
#memcached_flags="-l 127.0.0.1"
nginx_enable="YES"
# Mail Server
#exim_enable="YES"
# Dovecot
#dovecot_enable="YES"
#FTP
vsftpd_enable="YES"
#postgresql_enable="YES"
munin_node_enable="YES"
Tried to start sh -x /usr/local/etc/rc.d/apache22 start same erro appeared at bottom.
Also set as nakal told

Code:
:set fileformat=unix
:wq
Doesn't work
 
at least it can see rc.conf. I uncommented postgresql_enable="YES"
Code:
/usr/local/etc/rc.d/postgresql start
/usr/local/etc/rc.d/postgresql: WARNING: $postgresql_enable is not set properly - see rc.conf(5).
 
What are the contents of /etc/hosts ? I know sometimes Apache won't start if you don't have your hostname properly set in that file. I struggled with that problem on my server for about a week, lol.
 
CMonster95 said:
What are the contents of /etc/hosts ? I know sometimes Apache won't start if you don't have your hostname properly set in that file. I struggled with that problem on my server for about a week, lol.

Sorry didn't see the "resolved" tag.
 
No, the problem was not in apache, any service described in rc.conf was unable to restart. I think i put some russian character in rc.conf and that caused misspelled config.
Recreation of rc.conf from scratch did the trick.
 
Back
Top