Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Correct setup for 'single database mode' in Linux server?

Subscribe

Get notified when there's activity on this post

This question has been flagged
2 Replies
8619 Views
Avatar
Martin

In order to use OAuth I understand one must go to single database mode.

There seem to be only two ways to do it. The third way I was expecting seem to be broken:

  1. As indicated in General Settings -- "The public portal is accessible only if you are in a single database mode. You can launch the OpenERP Server with the option --db-filter=DATABASENAME to do so. "
  2. Specifying the database target in the URL -- http://subdomain.mydomain.com:8069/?db=DATABASENAME
  3. Specifying the database target in openerp-server.conf with dbfilter = DATABASENAME

I've tried dbfilter =, db_filter = and db-filter = in my openerp-server.conf, but none seem to work.

My circumstances:

  • I'm running on Ubuntu 12.04 LTS
  • My server start command is sudo service openerp-server start
  • my script contains :

     # Specify an alternate config file (Default: /etc/openerp-server.conf).
     CONFIGFILE="/etc/openerp-server.conf"
     # Additional options that are passed to the Daemon.
     DAEMON_OPTS="-c $CONFIGFILE"
     #
     case "${1}" in
         start)
            echo -n "Starting ${DESC}: "
            start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
                    --chuid ${USER} --background --make-pidfile \
                    --exec ${DAEMON} -- ${DAEMON_OPTS}
    

I've tried altering the start command to this . . .

        start-stop-daemon --start --db-filter=DATABASENAME --quiet

. . . but that just gets me this . . .

    Starting openerp-server: start-stop-daemon: unrecognized option '--db-filter=DATABASENAME'

Evidently the start-stop-daemon expects something different.

Can anyone tell me the right way to do this?

Where can I find the script for the start-stop-daemon?

2
Avatar
Discard
Lorenzo Cabrini

Well at least [openerp-server --help | grep filter] prints [--db-filter=REGEXP Filter listed database]. So there should be an option called --db-filter.

Martin
Author

Yes. That is the 1st method that I mention. It works as long as you run openerp as an application rather than a service.

Shahar Or

Great question, Martin. If you're using the Ubuntu packages and editing the init script (Lorenzo's answer) then package upgrades most likely overwrite your change in DAEMON_OPTS. How Do you deal with that?

Shahar Or

Also, did you find a way to do this in the configuration file, please? That would be preferred over editing the init script due to the overwriting issue.

Martin
Author

I did not go that far with it. Probably the thing to do is make a patch file from the original vs the altered script and keep it around for your upgrades. I suppose I should have done that and submitted it to the bug police. (So much to do, huh)

Shahar Or

Anyway, it seems fixed to me: https://bugs.launchpad.net/openobject-server/+bug/940439

Avatar
Lorenzo Cabrini
Best Answer

Try adding '--db-filter=DATABASENAME' to DAEMON_OPTS instead. As you are doing now you are passing it to start-stop-daemon, NOT openerp-server.

In the init script change the line DAEMON_OPTS="-c $CONFIGFILE" to DAEMON_OPTS="-c $CONFIGFILE --db-filter=DATABASENAME"

4
Avatar
Discard
Jan Pompe

Not the right place, sorry.

Martin
Author

In other words use this ´DAEMON_OPTS="-c $CONFIGFILE --db-filter=DATABASENAME"´ instead of this ´DAEMON_OPTS="-c $CONFIGFILE"´? That fixed it! Great call, thanks!

Avatar
Jan Pompe
Best Answer

I use this script and it works for me (not enough karma to place the link)

 #!/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
0
Avatar
Discard
Martin
Author

It seems you are new to this kind of forum. You should read the question more carefully, and you will see that you have not answered it at all. More experienced members will actually take karma points away from responses that do not offer a real answer to the original question.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now