#542 Support non-root interpreter installation and execution on Unix-like systems

None
open
nobody
None
none
1
2014-04-15
2013-04-27
mdlueck
No

Steps used to customize the ooRexx source code to correctly handle locating the pid file within the prefix directory structure. This allows ooRexx v4x to be built / installed / run by non-root users on a computer.

Perhaps update the source / configure process to detect if it is being built with a prefix, and then #ifdef detect that state in the below mentioned C file, and tack on that given prefix to the location of the pid file... per my working implementation example.

Copy / paste from a couple of emails:

On Thu, Apr 18, 2013 at 2:15 PM, Michael Lueck mlueck@lueckdatasystems.com wrote:

Without root/sudo perms to the share hosting server, I doubt I can accomplish this. Am I correct?

Disappointed indeed... :-(

Michael,

If I were you, I'd do this:

make clean

Then locate the file:

rexxapi\server\platform\unix\APIService.cpp

Around line 70 is this code:
#define RUN_AS_DAEMON

#ifdef RUN_AS_DAEMON
#define OOREXX_PIDFILE "/var/run/ooRexx.pid"
bool run_as_daemon = true;
#else
#define OOREXX_PIDFILE "/tmp/ooRexx.pid"
bool run_as_daemon = false;
#endif
Change the code to this:
#undef RUN_AS_DAEMON

#ifdef RUN_AS_DAEMON
#define OOREXX_PIDFILE "/var/run/ooRexx.pid"
bool run_as_daemon = true;
#else
#define OOREXX_PIDFILE "/<your_home_directory>/ooRexx.pid"
bool run_as_daemon = true;
#endif

Then rebuild and install to a directory you have write and execute privileges. Without testing, I believe that should work.

If you have problems, you're on your own.

--
Mark Miesfeld

=====================

Greetings ooRexx developers,

I will allow ooRexx to speak for itself...

(uiserver):u40009095:~ > which rexx
/kunden/homepages/35/d157794216/htdocs/opt/oorexx/bin/rexx

(uiserver):u40009095:~ > rexx -v
Open Object Rexx Version 4.1.2
Build date: Apr 20 2013
Addressing Mode: 32

Copyright (c) IBM Corporation 1995, 2004.
Copyright (c) RexxLA 2005-2012.
All Rights Reserved.
This program and the accompanying materials are made available under
the terms of the Common Public License v1.0 which accompanies this
distribution or at
http://www.oorexx.org/license.html

(uiserver):u40009095:~ > rexxtry.rex
REXX-ooRexx_4.1.2(MT) 6.03 20 Apr 2013
rexxtry.rex lets you interactively try REXX statements.
Each string is executed when you hit Enter.
Enter 'call tell' for a description of the features.
Go on - try a few... Enter 'exit' to end.
say 'Yes, it works! Thank you, Mark! :-)'
Yes, it works! Thank you, Mark!
............................................... rexxtry.rex on LINUX
exit

Customized ooRexx source code:
// For testing purposes comment out the following line to force RXAPI to
// run as a foreground process.
#undef RUN_AS_DAEMON

#ifdef RUN_AS_DAEMON
#define OOREXX_PIDFILE "/var/run/ooRexx.pid"
bool run_as_daemon = true;
#else
#define OOREXX_PIDFILE "/kunden/homepages/35/d157794216/htdocs/opt/oorexx/var/run/ooRexx.pid"
bool run_as_daemon = true;
#endif

Installation steps as follows:

Version: ooRexx-4.1.2.source.tar.gz
% ./configure --disable-static --prefix=/kunden/homepages/35/d157794216/htdocs/opt/oorexx
% make
% make install
mkdir ~/opt/oorexx/var
mkdir ~/opt/oorexx/var/run
Symlinks for ooRexx 4.1.2 as follows:

Add a symlink to support libraries compiled against the old ORexx 2.x from IBM
~/opt/oorexx/lib/ooRexx >ln -s librexxapi.so.4.0.4 librexxapi.so.2
Add rexxtry.rex support from the command line
~/opt/oorexx/bin > ln -s ../share/ooRexx/rexxtry.rex rexxtry.rex
And put the proper shebang in that target file

Thank you SSSSOOO much, Mark! The combined input from everyone is very appreciated.

Sincerely,

--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Discussion

  • Mark Miesfeld
    Mark Miesfeld
    2013-12-07

    • summary: Support non-root build / install / run via prefix'ing the pid file --> Support non-root interpreter installation and execution on Unix-like systems
     
  • Mark Miesfeld
    Mark Miesfeld
    2013-12-07

    Changing the title. You do not need to be root to build the interpreter.

     


Anonymous


Cancel   Add attachments