openerp 7 在ubuntu上设置开机启动

时间:2022-12-21 22:45:28

我们要让openerp开机运行起来。

第一步,先进入系统目录:

cd /etc/init.d

第二步,创建文件。命名为openerp-server

sudo vi openepr-server

第三步:在openerp-server文件中添加下面内容:

#!/bin/sh

### BEGIN INIT INFO
# Provides: openerp-server
# Required-Start:
$remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start:
$network
# Should-Stop: $network
# Default-Start: 2 3 4 5
#
Default-Stop: 0 1 6
# Short-Description: Enterprise Resource Management
software
# Description: Open ERP is a complete ERP and CRM software.
###
END INIT INFO

PATH=/bin:/sbin:/usr/bin
DAEMON=/opt/openerp/server/openerp-server
NAME=openerp-server
DESC=openerp-server

# Specify the user name (Default: openerp).
USER=openerp

# Specify an alternate config file (Default:
/etc/openerp-server.conf).
CONFIGFILE=”/etc/openerp-server.conf”

# pidfile
PIDFILE=/var/run/$NAME.pid

# Additional options that are passed to the Daemon.
DAEMON_OPTS=”-c
$CONFIGFILE”

[ -x $DAEMON ] || exit 0
[ -f $CONFIGFILE ] || exit 0

checkpid() {
[ -f $PIDFILE ] || return 1
pid=`cat $PIDFILE`
[ -d
/proc/$pid ] && return 0
return 1
}

case “${1}” in
start)
echo -n “Starting ${DESC}: ”

start-stop-daemon –start –quiet –pidfile ${PIDFILE} \
–chuid ${USER}
–background –make-pidfile \
–exec ${DAEMON} — ${DAEMON_OPTS}

echo “${NAME}.”
;;

stop)
echo -n “Stopping ${DESC}: ”

start-stop-daemon –stop –quiet –pidfile ${PIDFILE} \
–oknodo

echo “${NAME}.”
;;

restart|force-reload)
echo -n “Restarting ${DESC}: ”

start-stop-daemon –stop –quiet –pidfile ${PIDFILE} \
–oknodo

sleep 1

start-stop-daemon –start –quiet –pidfile ${PIDFILE} \
–chuid ${USER}
–background –make-pidfile \
–exec ${DAEMON} — ${DAEMON_OPTS}

echo “${NAME}.”
;;

*)
N=/etc/init.d/${NAME}
echo “Usage: ${NAME}
{start|stop|restart|force-reload}” >&2
exit 1
;;
esac

exit 0

注意你安装的路径要和我上一个帖子安装的一致,不然你就得修改上面代码中的文件路径

第四步:测试配置文件。

sudo /etc/init.d/openerp-server start

当执行上面这一条命令后,你访问 http://IP.com:8069能正常访问得到,证明你的配置文件配置成功。

第五步:设置开机启动。

sudo update-rc.d openerp-server defaults

到这里,openerp已经可以在你的ubuntu系统中实现开机启动了。

参考资料:http://www.theopensourcerer.com/2012/12/how-to-install-openerp-7-0-on-ubuntu-12-04-lts/

openerp 7 在ubuntu上设置开机启动的更多相关文章

  1. Linux上设置开机启动Java程序

    在Linux上设置开机启动Java程序,例如:test.jar 在Linux上启动Java程序的命令: nohup java -jar test.jar >/dev/>& &amp ...

  2. ubuntu下设置开机启动服务

    原文:http://blog.csdn.net/dante_k7/article/details/7213151 在ubuntu10.04之前的版本都是使用chkconfig来进行管理,而在之后的版本 ...

  3. tomcat在ubuntu中设置开机启动

    #!/bin/bash export JAVA_HOME=/usr/lib/jdk/jdk1.7.0_72 WEBROOT_PATH=/home/zhengze/workspace WEBSERVER ...

  4. ubuntu如何设置开机启动默认命令行界面

    图形模式下,首先进入终端: 1. 运行 sudo vi/etc/default/grub 2. 找到 GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” 3.改为 GR ...

  5. Ubuntu 16.04设置开机启动脚本的方法

    需求:公司卡片机容量太小,只有100G,由于使用的人比较的多,开机使用后有时候就会出现磁盘空间占满数据写不进去的情况,影响工作进度,而且每次使用完都得关掉卡片机,所以就有必要写个清理磁盘的脚本,当卡片 ...

  6. Ubuntu 14.04设置开机启动脚本的方法

    rc.local脚本 rc.local脚本是一个ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令.该脚本位于/etc/路径下,需要root权限才能修改. 该脚本具体格式如下: #! ...

  7. ubuntu设置开机启动脚本

    rc.local脚本 rc.local脚本是一个ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令.该脚本位于/etc/路径下,需要root权限才能修改. 该脚本具体格式如下: #! ...

  8. Ubuntu 18.04 启用 rc.local 设置开机启动

    ubuntu18.04 不再使用initd管理系统,改用systemd. 然而systemd很难用,改变太大,跟之前的完全不同. 使用systemd设置开机启动为了像以前一样,在/etc/rc.loc ...

  9. Ubuntu 18.04 设置开机启动脚本 rc.local systemd

    ubuntu18.04不再使用initd管理系统,改用systemd. ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.l ...

随机推荐

  1. url地址的图片路径

    url地址的图片路径: (./images/1.jpg) 中的./指根路径,有或没有都可以: (../images/1.jpg) 中的../指相对路径: (../../images/1.jpg) 中的 ...

  2. 一、Python 简介

    There should be one -- and preferably only one -- obvious way to do it. 一种解释型,面向对象的.带有动态语义的高级程序设计语言. ...

  3. Leetcode 83 Remove Duplicates from Sorted List 链表

    就是将链表中的重复元素去除 我的方法很简单就是如果链表的前后元素相同的话,将后一个元素删除 /** * Definition for singly-linked list. * struct List ...

  4. PL/SQL中批量执行SQL脚本(不可把所有的语句都复制到New SQL Windows)

    PL/SQL中批量执行SQL脚本,不可把所有的语句都复制到New SQL Window,因为这样会导致缓冲区过大而进程卡死! 最好的办法是将要执行的SQL脚本存放到指定文件中,如C:\insert.s ...

  5. Delphi 调试日子 - TLogger

    这段时间又开始用delphi了,才发现我对它这么的不熟悉! 简单的而有效的调试工具 Logger 这个是“榕树下”的作品,小巧而精悍.稍微调整了一下.在需要的地方加入 {$IFDEF DEBUG}   ...

  6. 《深入Java虚拟机学习笔记》- 第7章 类型的生命周期/对象在JVM中的生命周期

    一.类型生命周期的开始 如图所示 初始化时机 所有Java虚拟机实现必须在每个类或接口首次主动使用时初始化: 以下几种情形符合主动使用的要求: 当创建某个类的新实例时(或者通过在字节码中执行new指令 ...

  7. POJ -- 3233 求“等比矩阵”前n(n <=10^9)项和

    Matrix Power Series   Description Given a n × n matrix A and a positive integer k, find the sum S =  ...

  8. 【原创】leetCodeOj ---Remove Duplicates from Sorted List II 解题报告

    明日深圳行,心情紧张,写博文压压惊 囧 ------------------------------------- 原题地址: https://oj.leetcode.com/problems/rem ...

  9. [poj2528]Mayor's posters

    题目描述 The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campa ...

  10. MyEclipse10中启动出现OutOfMemoryError: PermGen space如何解决

    一篇关于技术的文档,分享给大家.在MyEclipse中启动程序运行,报错java.lang.OutOfMemoryError: PermGen space应该怎么办?这是eclipse 内存不够的原因 ...