I tried literally ALL ways to get this script running in the background (as startup script, as daemon, etc.)
....but you've not shown us any of the code which you used.
The 'ftpscript' is not executed, and nothing is written to the specified logfile
Did you check if the process you started was still running? What logfile? The code you've shown doesn't write any log files.
It would have helped if you had (also) provided some details of which linux this relates to.
Here's a sys V init script which should do the trick (if you know how to deploy it)....
#!/bin/sh
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 0
fi
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
RETVAL=0
start() {
gprintf "Starting inotify monitor: "
RETVAL=1
daemon YOURSCRIPT.sh
RETVAL=$?
return RETVAL
}
stop() {
gprintf "Stopping inotify monitor: "
killproc YOURSCRIPT.sh
RETVAL=$?
return RETVAL;
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
gprintf "Usage: %s {start|stop|restart}\n" "$0"
exit 1
esac
exit $?