Installing a Service

You may want to start the FTP server as soon as the system is up an running. Therefore, the binary distribution of Hermes FTP server was bundled with a precustomized Java Service Wrapper for Windows NT/2000/XP and Linux x86.

Before you install the service/daemon please check the settings in the application context file hermesftp-ctx.xml . In particular, find the option "ftp.root.dir" and set the value to an appropriate FTP data folder (e.g. c:/ftpdata or /home/ftp/data) .

Running Hermes FTP as NT Service

In order to install Hermes FTP Server as a NT service you have to execute the following batch file:

%HERMES_HOME%/service/bin/hermesftp-install-nt.bat
If everything went well, Hermes FTP Server is started automatically on system start from now on. You can start the service by executing the command
net start HermesFTPServer
The service is uninstalled by executing the script file:
%HERMES_HOME%/service/bin/hermesftp-uninstall-nt.bat
For further documentation refer to the Java Service Wrapper website.

Running Hermes FTP as Linux Daemon

The installation process of a daemon varies among linux distributions. The instructions in this document refer to Debian or Ubuntu distributions.

Login as "root" and change into the folder $HERMES_HOME/service/bin. Make sure the java wrapper script/binary is executable:

chmod 755 wrapper
chmod 755 hermesftp.sh
Open hermesftp.sh with a text editor and set the variable HERMES_HOME to the installation folder, example:
HERMES_HOME="/home/lbehnke/prg/hermesftp-0.2"
Start and stop the FTP server by executing the following commands
./hermesftp.sh start
./hermesftp.sh stop
View the log file $HERMES_HOME/service/logs/wrapper.log and make sure the application started without errors. If any errors occured you have possibly not installed java or the FTP ports 21 and 990 are already bound.

If the daemon started successfully create a soft link in the /etc/init.d folder

ln -s $HERMES_HOME/service/bin/hermesftp.sh /etc/init.d/hermesftp
The registration of daemons at different runlevels is done with update-rc.d. The utility update-rc.d automatically updates the system V style init script links /etc/rcrunlevel.d/NNname to scripts /etc/init.d/name. The placeholder runlevel is one of the runlevels supported by init (0123456789S). The placeholder NN is the two-digit sequence code used by init to decide which order to run the scripts in. Change into the /etc/init.d folder and issue the following command:
update-rc.d hermesftp defaults
This will make links to start the service in runlevels 2, 3, 4, and 5 and stop the service in runlevels 0, 1, and 6. The default sequence code is 20.

SuSE users must use the chkconfig (or insserv) script to register the daemon:

chkconfig -a hermesftp

Now restart the system:

shutdown -r now
In case you wish to uninstall the daemon, just execute
update-rc.d -f hermesftp remove
rm -f /etc/init.d/hermesftp
For SuSE users the corresponding command would be:
chkconfig -d hermesftp
For further documentation refer to the Java Service Wrapper website.