# Odd behaviour related to rc.conf



## gman88 (Jul 21, 2010)

I'm about 4 weeks into my FreeBSD experience, from Linux, and this is probably an ignorant question.....but here goes.   I had some scripts which  built an older version of Apache (1.3.41) and - basically because it's something that I'm familiar with - I built it with my old  Slackware scripts.  I absolutely need certain things compiled with Apache and I'm not comfortable enough with FreeBSD, yet, to just use ports.  At any rate, I own valid, third-party signed certificates but as I was building this thing I had not installed them.  I built vsftpd, too.  In /etc/rc.conf I had added enable_apache="YES" and enable_vsftpd="YES".  I had made corresponding start files (apache.sh and vsftpd.sh) at /usr/local/etc/rc.d.  The odd dimension, here, is that everything had worked for a week or so.   I added a mail server and I cannot imagine that, somehow, that has anything to with this.  But, last night vsftpd would not run from the call in /etc/rc.conf.  Of course, since it's an ssl web server with no certificates (well, it was....) there was a request at boot time to enter a password.  All of a sudden, this seemed to be interfering with vsftpd starting.  As soon as I generated some self-signed certificates as a temporary fix, vsftpd starts at boot time.  

It's simply odd to me that (1) this worked for a couple of weeks without the certificates, and,(2) now it doesn't.  The certificates have to be installed, anyway - but could anyone tell me why the request to enter my password for Apache, at boot, would suddenly bugger the vsftpd start call......

Things like this - totally inconsequential, I suppose - drive me nuts....

Thanks for any input.


----------



## SirDice (Jul 22, 2010)

gman88 said:
			
		

> In /etc/rc.conf I had added enable_apache="YES" and enable_vsftpd="YES".


Wrong way around. It's:

```
apache_enable="YES"
vsftp_enable="YES"
```


----------



## gman88 (Jul 22, 2010)

*I think that I posted wrong..*

Thanks - I'll check it, but, I think that I just typed that post incorrectly....


----------



## wblock@ (Jul 23, 2010)

gman88 said:
			
		

> I'm about 4 weeks into my FreeBSD experience, from Linux, and this is probably an ignorant question.....but here goes.   I had some scripts which  built an older version of Apache (1.3.41) and - basically because it's something that I'm familiar with - I built it with my old  Slackware scripts.  I absolutely need certain things compiled with Apache and I'm not comfortable enough with FreeBSD, yet, to just use ports.



This is a recipe for future pain.  There are three things about ports that are often overlooked but really important:

1. Consistency: config files go in LOCALBASE/etc, binaries (usually) go in LOCALBASE/bin, and so on.
2. Patches specifically for FreeBSD.  Maybe needed, maybe just nice, but the porter went to the effort of putting them in for a reason.
3. Deinstalling/upgrading.  You can deinstall a port and all the files are gone.  There won't be forgotten little files hanging around taking up disk space and interfering with the new version.



> ... In /etc/rc.conf I had added enable_apache="YES" and enable_vsftpd="YES".  I had made corresponding start files (apache.sh and vsftpd.sh) at /usr/local/etc/rc.d.  The odd dimension, here, is that everything had worked for a week or so.   I added a mail server and I cannot imagine that, somehow, that has anything to with this.  But, last night vsftpd would not run from the call in /etc/rc.conf.  Of course, since it's an ssl web server with no certificates (well, it was....) there was a request at boot time to enter a password.  All of a sudden, this seemed to be interfering with vsftpd starting.  As soon as I generated some self-signed certificates as a temporary fix, vsftpd starts at boot time.



This probably falls under the "consistency" entry above.  You didn't show your scripts, but I'd guess some kind of race condition, or maybe a stale pid file or lock or something like that.  Using the port rc.d files is not a guarantee, but it's a pretty safe bet.


----------

