Command :
root@kali:~# cat /etc/init.d/metasploit
You will see this result
#! /bin/sh
### BEGIN INIT INFO
# Provides: metasploit
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
# chkconfig: 2345 80 30
# description: Metasploit
#
exec /opt/metasploit/ctlscript.sh "$@"
The issue is happened because the script has no end of LSB comment. I'm little bit curious, what is lSB comment look like. So I see the other init script to find out about LSB comment. I look MySQL's.
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: mysql
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $network $time
# Should-Stop: $network $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop the mysql database server daemon
# Description: Controls the main MySQL database server daemon "mysqld"
# and its wrapper script "mysqld_safe".
### END INIT INFO
#
set -e
set -u
<snip>
*)
echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
exit 1
;;
esac
See the different? YES! MySQL init script has END INIT INFO, in the other side, metasploit don't have any. So I try to insert END INIT INFO at metasploit init script. Now it just look like this:
#! /bin/sh
### BEGIN INIT INFO
# Provides: metasploit
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
# chkconfig: 2345 80 30
# description: Metasploit
#
### END INIT INFO
exec /opt/metasploit/ctlscript.sh "$@"
And everything is OK now. Do apt-get install -f after you edit and save the file.
Command :
root@kali:~# apt-get install -f
0 comment:
Post a Comment