This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 631256 - pbs_server erroneously autocreates new serverdb
pbs_server erroneously autocreates new serverdb
Status: CLOSED NEXTRELEASE
Product: Fedora EPEL
Classification: Fedora
Component: torque (Show other bugs)
el5
All Linux
low Severity low
: ---
: ---
Assigned To: Steve Traylen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-07 13:35 EDT by Nico Kadel-Garcia
Modified: 2010-10-14 17:14 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-14 17:14:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Refuses to start pbs_server if $PBS_HOME/server_priv/serverdb is absent. (1.12 KB, text/plain)
2010-09-07 13:35 EDT, Nico Kadel-Garcia
no flags Details

  None (edit)
Description Nico Kadel-Garcia 2010-09-07 13:35:09 EDT
Created attachment 444706 [details]
Refuses to start pbs_server if $PBS_HOME/server_priv/serverdb is absent.

Description of problem:
  The Torque init script for pbs-server auto-generates new Torque databases. This is dangerous in cases of /var/torque or other configured Torque database repositories which are temporarily offline. The generation of a new server configuration should be an *option*, not automatic.

Version-Release number of selected component (if applicable):
  2.3.10-1

How reproducible:
  Install torque-server package, run init scripts.

Steps to Reproduce:
1. yum install torque-server
2. ls -lR /var/torque/server_priv/serverdb
3. /sbin/service torque-server start
4. ls -lR /var/torque/server_priv/serverdb
  
Actual results:
    A new serverdb is created.

Expected results:
    The init script should fail, with no server configured.

Additional info:
    This is an old configuration issue. Tweaking the init script to add a "enable" option is easy, but in the meantime, my attached file notifies the user and exits, correctly.
Comment 1 Steve Traylen 2010-09-07 13:52:10 EDT
I agree, I think it's better just to exit in this case where it does not exist.
A lot safer.

Will change it.

Steve.
Comment 2 Steve Traylen 2010-09-07 17:32:03 EDT
Hi,

First I think changing it to make it safer is good but am confused under which
circumstance it will currently cause problems?

Current script contains 

PBS_HOME=/var/torque

                if [ -r $PBS_HOME/server_priv/serverdb ]
                then
                        daemon $PBS_DAEMON
                else
                        daemon $PBS_DAEMON -t create
                fi

how does this overwrite the database if it already exists?

Stev.e
Comment 3 Mark Chappell 2010-09-22 05:48:57 EDT
Automatically creating the database if one does not exist is not an uncommon thing to do.   The init script for MySQL does it, although the init script for postgres does not.

I too can not see how the current version is dangerous...  Any further comments Nico?
Comment 4 Nico Kadel-Garcia 2010-09-22 07:26:08 EDT
Yes, certainly. In my current working environment, /var/torque lives on a network share for failover use. If, for any reason, that network based share is unavailable, the secondary should not start at all lest it interfere with normal operations. This is a relatively safe way to detect such unconfigured states. Admittedly, my current share is /var/torque, so server_piv doesn't exist when the mounting is messed up, so the init fails with ugly messages. But I'd like that error message to be more meaningful.

Torque and other clustering tools are more dangerous than MySQL, because they send server authorized tasks to other systems, even if it's only on localhost. It seems very appropriate to exert more caution before activating it. The fact that it's automatically installed with the init script turned off is good, but I think insufficient.
Comment 5 Steve Traylen 2010-09-22 09:12:36 EDT
Okay, I'll exit with code 5 I think it is the file does not exist with
some suggestion.

Thanks for the clarification.

Steve.
Comment 6 Mark Chappell 2010-09-22 09:48:13 EDT
(In reply to comment #5)
> Okay, I'll exit with code 5 I think it is the file does not exist with
> some suggestion.

Might be worth adding a "createdb" option in the init script, which is the way postgres-server does it...
Comment 7 Steve Traylen 2010-10-14 17:14:41 EDT
Okay, I think we are there and create method has been added as well
as not create with a start call.

This will make F15 and I'll add to older with any new releases.

I've requested the addition upstream 

http://www.clusterresources.com/bugzilla/show_bug.cgi?id=90

but it's definitely a matter of opinion if it should be added.

Steve.

Note You need to log in before you can comment on or make changes to this bug.