为了将LibreOffice 4.4安装到我的Debian 8(Jessie)中,我刚从Debian 7.5获得了所有bash脚本,并以相同的方式运行到D8中.
我知道新版本有一些变化,但我不能再像这样使用我的服务了:
sudo service libreoffice start
这样做不会启动任何东西,我必须使用以下方式启动它:
sudo /etc/init.d/libreoffice start
奇怪的是,做的时候(参数不好):
sudo service libreoffice dzedjiodjzedj
这是我的/etc/init.d/libreoffice文件:
# # libreoffice This shell script takes care of starting and stopping the LibreOffice Daemon # # chkconfig: - 80 20 # ### BEGIN INIT INFO # Provides: libreofficedaemon # required-Start: $network $syslog # required-Stop: $network $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: Init.d script to run a LibreOffice Daemon # Short-Description: start and stop LibreOffice Daemon ### END INIT INFO NAME="LibreOffice Service" LIBREOFFICE_HOME=/opt/libreoffice4.4 LIBREOFFICE_USER=libreoffice export LIBREOFFICE_HOME LIBREOFFICE_USER start() { echo -ne "Starting $NAME. \n" su $LIBREOFFICE_USER -c "$LIBREOFFICE_HOME/start.sh" } stop() { echo -ne "Stopping $NAME. \n" su $LIBREOFFICE_USER -c "$LIBREOFFICE_HOME/stop.sh" } kill() { echo -ne "Force close of $NAME. " killall -u $LIBREOFFICE_USER } cd $LIBREOFFICE_HOME case "$1" in start|stop) $1;; restart) stop; start;; kill) kill;; *) echo "Usage: /etc/init.d/libreoffice {start|stop|restart|kill}" exit 1 ;; esac exit 0
而我昨天刚刚用tomcat8服务运行那个问题,我刚开始手动服务和sudo服务tomcat8开始工作之后,但没有libreoffice一个..
来自Debian Jessie发行说明:
When you are asked if any file in the /etc/init.d directory,or the /etc/manpath.config file should be replaced by the package maintainer’s version,it’s usually necessary to answer “yes” to ensure system consistency
解决方法
使用systemd,您现在必须使用systemctl:
sudo systemctl start libreoffice