Subject Setup script for Unix FHS 2.3 compliance
Author Rick Debay
My goal is to allow /opt to be read-only. The File system Hierarchy
Standard supports this by requiring any lock, configuration, and
variable files to be located outside of /opt.

This is a (poorly written) script that allows this by using symlinks to
point to the appropriate directories.
Testing has been minimal as the hardware has been actively resisting me.

# /opt/firebird/
# make sure everything is owned by firebird
su firebird

# firebird installation directory
cd /opt/firebird

mkdir /var/log/firebird
mkdir /var/opt
mkdir /var/opt/firebird
mkdir /var/opt/firebird/data

# don't use /var/tmp/firebird as distro or admin may periodically sweep
mkdir /var/opt/firebird/tmp

# mount point for tmpfs
# TODO mount/umount in /etc/init.d/firebird so owner is set as firebird
mkdir /var/opt/firebird/tmp/tmpfs
mkdir /var/lock/firebird

# execute permission is needed to create a file through a symlink
# be sure that chkstat permission files preserve this
chmod 740 /var/lock/firebird
mkdir /etc/opt
mkdir /etc/opt/firebird

# the move can be replaced by having ln overwrite the file, as it will
be recreated upon start
mv -v /opt/firebird/isc_event1.linux-fd1b /var/lock/firebird/
mv -v /opt/firebird/isc_guard1.linux-fd1b /var/lock/firebird/
mv -v /opt/firebird/isc_init1.linux-fd1b /var/lock/firebird/
mv -v /opt/firebird/isc_lock1.linux-fd1b /var/lock/firebird/
ln -s /var/lock/firebird/isc_event1.linux-fd1b
ln -s /var/lock/firebird/isc_guard1.linux-fd1b
ln -s /var/lock/firebird/isc_init1.linux-fd1b
ln -s /var/lock/firebird/isc_lock1.linux-fd1b

mv -v /opt/firebird/security2.fdb /var/opt/firebird/data/
ln -s /var/opt/firebird/data/security2.fdb

mv -v /opt/firebird/firebird.conf /etc/opt/firebird/
mv -v /opt/firebird/aliases.conf /etc/opt/firebird/
ln -s /etc/opt/firebird/firebird.conf
ln -s /etc/opt/firebird/aliases.conf

mv -v /opt/firebird/firebird.log /var/log/firebird/
ln -s /var/log/firebird/firebird.log