LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-09-2011, 12:54 PM   #1
xbeck
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Rep: Reputation: Disabled
Start python application (MoinMoin) at startup / by running a script


Dear all,

I have a personal copy of MoinMoin installed locally on my laptop running Ubuntu 10.04. I usually run the standalone server by changing to the dir where the moin.py resides and executing:

Code:
./moin.py server standalone
from the shell (bash). Now I would like to write a small script runmoin.sh. I have tried by

Code:
#!/bin/bash
./moin.py server standalone > /dev/null 2>&1 &
Interestingly, this works if I do

Code:
sh runmoin.sh
directly in that dir. However, if I create a link to this script (in /bin) and start if from anywhere,
I get this error message (I think from MoinMoin)

Code:
ConfigurationError

data_dir "data" does not exist, or has incorrect ownership or
permissions.

Make sure the directory and the subdirectory "pages" are owned by the web
server and are readable, writable and executable by the web server user
and group.

It is recommended to use absolute paths and not relative paths. Check
also the spelling of the directory name.
I don't have a clue how to fix this? Any suggestions or other options?

How would I automatically start the MoinMoin standalone directly after login?

Any help is greatly appreciated!

Thanks, xbeck.
 
Old 07-09-2011, 01:12 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Have you tried using absolute paths instead of relative ones?
 
Old 07-09-2011, 01:23 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Moin(-1.9.3) comes with a start script : moin-1.9.3/build/scripts-2.6/moin :

Code:
#! /usr/bin/python
#Fix and uncomment those 2 lines if your moin command doesn't find the MoinMoin package:
#import sys
#sys.path.insert(0, '/usr/lib/python/site-packages')
from MoinMoin.script.moin import run
run()
Start command example : moin server standalone

..

Last edited by knudfl; 07-09-2011 at 01:25 PM.
 
Old 07-09-2011, 02:38 PM   #4
xbeck
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for your replies!

grail: yes, I have used absolute paths, no difference: it works if I execute the script in the same directory (sh runmoin_fullpaths.sh), but if I make a link to the script and put this link in /bin, same 'Configuration' error

EDIT: even trying sh /full/path/to/script/runmoin.sh also gives 'Configuration' error.

knudfl: Interesting. But gives same error with 'Configuration' as above.

Apparently there is really a difference between executing the script / the command directly in the dir or running it from somewhere else?!

Last edited by xbeck; 07-09-2011 at 02:44 PM.
 
Old 07-09-2011, 04:58 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
cd moin-1.9.3/
# python setup.py install


which moin : The reply is : /usr/bin/moin
Meaning that you can run 'moin server standalone' from any location.

..
 
Old 07-09-2011, 05:15 PM   #6
xbeck
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
cd moin-1.9.3/
# python setup.py install


which moin : The reply is : /usr/bin/moin
Meaning that you can run 'moin server standalone' from any location.

..
Yes, okay. I renamed that /usr/bin/moin to be sure there is no conflict with my (modified) moin.py in my wiki dir. But that still does not explain why the script behaves differently between a) executing it directly in the dir, e.g. sh runmoin.sh and b) executing the exact same script from somewhere else, e.g. sh /path/to/script/runmoin.sh
The script just contains the two lines

Code:
#!/bin/bash
/path/to/wiki/moin.py server standalone  > /dev/null 2>&1 &
So I thought it does not matter from where I run it?

But it became clear that this is probably more related to MoinMoin, so I will ask there. Thanks!
 
Old 07-10-2011, 01:28 AM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Well I am not sure what the issue might be, but an easy enough solution for your script is to put a cd into it so you are running from the location.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] python - tkinter application auto start on boot up - problems awn Linux - Newbie 2 05-03-2010 08:28 PM
How to start an application/service in startup? lawrence_lee_lee Linux - Software 4 09-21-2007 02:57 AM
Running GUI application on startup in VNC serabut Linux - Software 4 11-16-2006 09:52 PM
problem apache2 CGI python MoinMoin (wiki) brasschaat Linux - Software 1 08-11-2004 08:26 AM
Guidance needed: running an application on startup. nyumedic2000 Linux - General 1 07-15-2004 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration