Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/etc/init.d/firebird script stops firebird with fbmgr and password [CORE3077] #3456

Open
firebird-automations opened this issue Jul 21, 2010 · 14 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Gili Buzaglo (gland)

Attachments:
firebird
firebird
FirebirdStartupScriptForSolaris.v2

Scenario is as follows:
1) change password for sysdba using gsec
2) perform /etc/init.d/firebird stop
It does not stop the firebird correctly since it uses hard coded(in script) masterkey password.

@firebird-automations
Copy link
Collaborator Author

Commented by: Gili Buzaglo (gland)

The attached file replaces the /etc/init.d/firebird in my system
and it works for me.
Please comment if you know any better solutions
Thanks

@firebird-automations
Copy link
Collaborator Author

Modified by: Gili Buzaglo (gland)

Attachment: firebird [ 11685 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

If you do not need multiple instances - our method is OK. Moreover - you need not kill guardian explicitly. Firebird 2.1 is processing signal 15 (I suppose it's send by pkill by default ?) and exits nornally, after which guardian also exits. Please check this to make sure signal is processed correctly. If not - you are in danger of corrupting databases when server is killed by unprocessed signal.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Gili Buzaglo (gland)

Hi
Thanks for your response.
The default is a SIGTERM(15) signal and firebird exists fine.
The problem with current method is:
a) fbmgr -shut runs with sysdba masterkey hard coded. This causes an error after you change sysdba's password.
b) Our service that comes at startup(reboot) stops and starts firebird to make sure all old connections are removed.
This caused fbserver to crash and not come up until I've replaced security2.fdb with a default one.
Thanks
-gili

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

I know very well what's a problem with current method:-)
Moreover, on linux it's replaced long ago with almost what you suggest, and additional code was added to fbserver to process signals 2 and 15. What I ask you to test is - does this code work correctly on Solaris? If yes, fbserver after pkill will cleanup, call exit(0) and after it fbguard will also shutdown, no need to kill it separately.

@firebird-automations
Copy link
Collaborator Author

Commented by: Gili Buzaglo (gland)

For now, it works for me as is ...
I will try next week without the pkill to fbguard.(I read somewhere that fbguard might reinit fbserver, this is why I've
placed it in the first place). Is there any harm leaving it anyway?(I dont want to recreate a flar ..)

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

If you perform normal shutdown of fbserver (it must be so), fbguard will not reinit it. I ask you about this experiment mainly to make sure that fbserver shutdown is grace on Solaris.

@firebird-automations
Copy link
Collaborator Author

Modified by: Gili Buzaglo (gland)

Attachment: firebird [ 11689 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Gili Buzaglo (gland)

I've tested the attached file(pkill fbserver only) and it works fine.
Thanks for your help.
-gili

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Gili, reviewing your startup script I've noticed some more problems (compared with 2.1 head, may be for 2.1.1 this changes were not present).

1) Somewhy you export PATH to firebird binaries. This is not needed for firebird to run.
2) Missing change runUser support. If forebird runs as 'root', this is not good from security POV.

I've added a kind of 'ideal' 2.1 startup script. Can you test it in your environment? (I know that if you were always runnign as root it may be problematic to run as non-root, therefore in the worst case change FbRunUser to be root in the script for your tests)

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Attachment: FirebirdStartupScriptForSolaris.v2 [ 11700 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Gili Buzaglo (gland)

Hi Alexander
Sorry For responding after so long.
I dont like saving the pid into a file. pkill $pname is more safe for me.
I've tried your script, when trying to stop firebird it got stuck.
I've checked and the file with pid was not created.
BTW, if the user calls start 2 times by mistake, will the file still be there?
Thanks
-gili

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

No problems - certainkly you've needed timeto check for.
With 'pkill $pname' there is one problem - if you need to have more than one FB instance, you can't stop single instance with it. Do not worry any more please - I will activate my VM with Solaris and take care for scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants