automatically starting PostgreSQL
Hi all, FreeBSD 6.2: I built PostgreSQL from source and copied the supplied startup script to /etc/rc.d/postgresql. The script works as expected. In /etc/rc.conf I've added the following: postgresql_enable=YES expecting this to automatically start PostgeSQL at boot, yet this doesn't happen and there is nothing in any error log that I can find that mentions any failure. ? thanks, --charlie -- Charles Farinella Appropriate Solutions, Inc. (www.AppropriateSolutions.com) [EMAIL PROTECTED] voice: 603.924.6079 fax: 603.924.8668 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: automatically starting PostgreSQL
Charles Farinella írta: Hi all, FreeBSD 6.2: I built PostgreSQL from source and copied the supplied startup script to /etc/rc.d/postgresql. The script works as expected. In /etc/rc.conf I've added the following: postgresql_enable=YES expecting this to automatically start PostgeSQL at boot, yet this doesn't happen and there is nothing in any error log that I can find that mentions any failure. Try to rename it to postgresql.sh and give execute rights. Laszlo ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: automatically starting PostgreSQL
Nagy László Zsolt wrote: Try to rename it to postgresql.sh and give execute rights. Execute rights, yes, but you shouldn't rename it to foo.sh under 6.2 -- that's not how things are supposed to work in recent releases. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW signature.asc Description: OpenPGP digital signature
Re: automatically starting PostgreSQL
Execute rights, yes, but you shouldn't rename it to foo.sh under 6.2 -- that's not how things are supposed to work in recent releases. Without the PROVIDE: in the rc script, it won't get executed unless it has an .sh extension. man rc has details, but .sh should still work and I think is required without the rcorder keywords. Josh ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: automatically starting PostgreSQL
On Mon, 2 Apr 2007, Charles Farinella wrote: I built PostgreSQL from source In other words, not from ports? Or if it was from ports, which port? and copied the supplied startup script to /etc/rc.d/postgresql. The script works as expected. Yes, but that's not where it should be in FreeBSD, if that's even a startup script meant for FreeBSD. In /etc/rc.conf I've added the following: postgresql_enable=YES expecting this to automatically start PostgeSQL at boot, yet this doesn't happen and there is nothing in any error log that I can find that mentions any failure. For that to work, you'd have to have the (correct) script in /usr/local/etc/rc.d. Remove the source version of PostgreSQL and install it from the appropriate port, and the port will install the right script in the right place. -Warren Block * Rapid City, South Dakota USA ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: automatically starting PostgreSQL
Warren Block wrote: On Mon, 2 Apr 2007, Charles Farinella wrote: I built PostgreSQL from source In other words, not from ports? Or if it was from ports, which port? and copied the supplied startup script to /etc/rc.d/postgresql. The script works as expected. Yes, but that's not where it should be in FreeBSD, if that's even a startup script meant for FreeBSD. In /etc/rc.conf I've added the following: postgresql_enable=YES expecting this to automatically start PostgeSQL at boot, yet this doesn't happen and there is nothing in any error log that I can find that mentions any failure. For that to work, you'd have to have the (correct) script in /usr/local/etc/rc.d. Remove the source version of PostgreSQL and install it from the appropriate port, and the port will install the right script in the right place. Thank you all for the responses, please help me understand how this works. For reasons having to do with our particular operation, it is our custom to build many packages from source code no matter the operating system, so I don't want to install from the ports tree. The script I used is one which is part of the PostgreSQL package and is specifically for FreeBSD. As I said the script works as expected. '/etc/rc.d/postgresql start|stop|restart' all work. I also have a duplicate script in /usr/local/etc/rc.d which also works as expected when run manually. Neither of these start the server at boot time. I have an apache2 installation also built from source code, and also with a script from an external source, also placed in /etc/rc.d and referenced by the line 'apache2_enable=YES', and this *does* start at boot time. So I am a little confused as to what I need to do. If I add .sh to /usr/local/etc/rc.d/postgresql, in my /etc/rc.conf do I change my reference line to 'enable_postgresql.sh=YES'? thanks again for the help. --charlie -- Charles Farinella Appropriate Solutions, Inc. (www.AppropriateSolutions.com) [EMAIL PROTECTED] voice: 603.924.6079 fax: 603.924.8668 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: automatically starting PostgreSQL
For reasons having to do with our particular operation, it is our custom to build many packages from source code no matter the operating system, so I don't want to install from the ports tree. Did you know that when you install from the ports tree, it will actually download the sources, make important patched for freebsd, and install from that source? In particular, you can give CFLAGS, makefile defines etc. In addition, when you install it from the ports tree, it gets recorded in the package database so you can install other applications that depend on postgresql. (For example, pgadmin3). Why do you want to install it from the sources? If you only want to optimize for your CPU and compile some contrib/extension modules, then you do not need to install from a source tarball yourself. Using the port will be enough. The script I used is one which is part of the PostgreSQL package and is specifically for FreeBSD. As I said the script works as expected. '/etc/rc.d/postgresql start|stop|restart' all work. I also have a duplicate script in /usr/local/etc/rc.d which also works as expected when run manually. Neither of these start the server at boot time. First of all, since postgresql is not part of the base system, you should put its rc script under /usr/local/etc/rc.d instead of /etc/rc.d. The rc script won't be execute unless the following criterion are met: 1. The script is executeable (chmod +x filename) 2. The script has a .sh suffix, OR it uses rcorder. (See: man rcorder). Using rcorder is the better because you can define when to start your service. (Obvious example: you need to start networking before starting postgresql...) 3. If the script supports rc variables, then probably you need to adjust some variables in /etc/rc.conf. However, it depends on the script itself. Most ports work with rc scripts. Custom programs installed from source may not need this. I have an apache2 installation also built from source code, and also with a script from an external source, also placed in /etc/rc.d and referenced by the line 'apache2_enable=YES', and this *does* start at boot time. I guess because it is named apache.sh instead of apache, am I right? So I am a little confused as to what I need to do. If I add .sh to /usr/local/etc/rc.d/postgresql, in my /etc/rc.conf do I change my reference line to 'enable_postgresql.sh=YES'? Of course not. The rc variables can be set in rc.conf. They will be checked by the postgresql.sh script. E.g. it is not the base system that checks these variables. Putting variables in rc.conf for programs like postgresql is good because usually you want to disable/enable services in rc.conf. Configuring postgresql is another story. However, it is the startup script of your program that needs to have support for rc variables. I hope this helps. Best, Laszlo ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: automatically starting PostgreSQL
For reasons having to do with our particular operation, it is our custom to build many packages from source code no matter the operating system, so I don't want to install from the ports tree. The ports tree is just there for installation from source and putting the software after compile into canonical locations (and adding usually the necessary startup scripts etc. in the process - Ports are not to be mixed with packages. As FreeBSD supports the source centric way from centralised location, there shouldn't really be any need for doing the compile outside the ports tree. You can basically tweak the ports to your hearts content (most of the relevant options can be tweaked from the ports Makefile already) and in addition the port installs into location using a method the rest of FreeBSD users can give you meaningful advice. -Reko ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: automatically starting PostgreSQL
On Mon, Apr 02, 2007 at 03:09:29PM -0400, Charles Farinella wrote: [...] For reasons having to do with our particular operation, it is our custom to build many packages from source code no matter the operating system, so I don't want to install from the ports tree. Short answer: to get it working the way you expect it to under FreeBSD, you will have to apply the patches for Postgresql in the ports tree. -- Jonathan Chen [EMAIL PROTECTED] -- Only the meek get pinched. The bold survive. - Ferris Bueller ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: automatically starting PostgreSQL
Reko Turja wrote: Ports are not to be mixed with packages. If you are using ports and packages solely in FreeBSD Terms, then this isn't correct*. Once installed, there is no/little-if-any difference; /var/db/pkg is common to both, and the standard package tools operate equally well for upgrading and/or de-installation. I'm not trying to stomp anyone, but this is an area that confused me Once Upon A Time, and we don't do anyone any favors by continuing to propagate this statement as an axiom. Kevin Kinsey *I'm ready to accept responses from a superior intellect who says I'm wrong, but I really don't think so in this case. -- Death has been proven to be 99% fatal in laboratory rats. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]