Rocket jBASE

 View Only
  • 1.  Using sudo in jBase programs

    Posted 03-24-2023 14:30

    We are running jBase 5.2 on linux. Back when we were running 4.2  we used to use sudo to run jBase commands. For example we might have this line in a program:

    EXECUTE "sudo j4 SP-CLEAR BLUE-FQ" 

    This would clear out all the print jobs from the BLUE-FQ form queue even if a print job was protected.

    The j4 file just set up some jBase environment variables so sudo would work.

    My question is - will this still work? If so, what environment variables are needed in the j4 file and where should the j4 file be placed?

    Thanks for any help.



    ------------------------------
    Warren Moriarity
    IT Manager
    Rocket Forum Shared Account
    ------------------------------


  • 2.  RE: Using sudo in jBase programs

    ROCKETEER
    Posted 03-24-2023 15:46

    Warren,

    I am not aware of any j4 file in jBASE 4.x, so,  it may have been something specific to your installation, in which case we would need to see an example before being able to provide feedback.

    Mike



    ------------------------------
    Mike Street
    Technical Support Engineer
    Rocket Internal - All Brands
    ------------------------------



  • 3.  RE: Using sudo in jBase programs

    Posted 03-24-2023 16:14

    Hi Mike,

    It's not part of jbase - it's just a text file containing environment variables that technical support at jBase came up with for us some years ago - it looked something like this:

    JBCRELEASEDIR=/opt/jbase4/4.1 ; JBCGLOBALDIR=/opt/jbase4/4.1
    export JBCRELEASEDIR JBCGLOBALDIR
    LD_LIBRARY_PATH=$JBCRELEASEDIR/lib:/usr/ccs/lib:/usr/lib
    LIBPATH=$JBCRELEASEDIR/lib:/usr/ccs/lib:/usr/lib
    SHLIB_PATH=$JBCRELEASEDIR/lib:${SHLIB_PATH:-/usr/lib:/lib}
    export LD_LIBRARY_PATH LIBPATH SHLIB_PATH
    PATH=/opt/jbase4/4.1/bin
    export PATH

    I modified it for our current jBase, but it is not working:

    JBCRELEASEDIR=/opt/jbase5/5.2 ; JBCGLOBALDIR=JBCGLOBALDIR=/opt/jbase5/5.2
    export JBCRELEASEDIR JBCGLOBALDIR
    LD_LIBRARY_PATH=$JBCRELEASEDIR/lib:${LD_LIBRARY_PATH}:/usr/lib
    LIBPATH=$JBCRELEASEDIR/lib:${LIBPATH}:/usr/lib
    SHLIB_PATH=$JBCRELEASEDIR/lib:${SHLIB_PATH}:/usr/lib:/lib
    export LD_LIBRARY_PATH LIBPATH SHLIB_PATH
    PATH=$JBCRELEASEDIR/bin
    export PATH



    ------------------------------
    Warren Moriarity
    IT Manager
    Rocket Forum Shared Account
    ------------------------------



  • 4.  RE: Using sudo in jBase programs

    ROCKETEER
    Posted 03-27-2023 12:54

    Warren,

    If you change "JBCGLOBALDIR=JBCGLOBALDIR=/opt/jbase5/5.2" to be "JBCGLOBALDIR=/opt/jbase5/5.2" then perhaps your script might have a better chance of working.

    If you continue to experience problems with the script, then please provide more information on the errors/problems you encounter.

    Mike



    ------------------------------
    Mike Street
    Technical Support Engineer
    Rocket Internal - All Brands
    ------------------------------



  • 5.  RE: Using sudo in jBase programs

    ROCKETEER
    Posted 03-27-2023 12:54

    Warren,

    Your new script would work better if you changed "JBCGLOBALDIR=JBCGLOBALDIR=/opt/jbase5/5.2" to "JBCGLOBALDIR=/opt/jbase5/5.2".

    Otherwise, it should work on jBASE 5.2

    I should also point out that the script should not be necessary if you are using EXECUTE, as your jBASE session should already be aware of its environment. It should only be necessary from a command prompt.



    ------------------------------
    Mike Street
    Technical Support Engineer
    Rocket Internal - All Brands
    ------------------------------



  • 6.  RE: Using sudo in jBase programs

    Posted 03-27-2023 13:56

    Oops! Thanks for pointing that out. However, correcting the mistake in the file did not solve the problem. When I type:

     sudo j4 SP-CLEAR EPSON710

    on the command line I do not get an error message, but the form queue is not cleared of print jobs.

    We run a program automatically every dayend to clear all the print jobs from most of our form queues. 

    Generally EXECUTE "SP=CLEAR form-queue" works fine in the program. But occasionally there will be a print job that did not have a "U" option when the "SP-ASSIGN" was set for that print job. When this happens the program  asks for the password of the user that created the print job and someone needs to manually intervene to input the password and get our automatic dayend processes running again.

    We used to incorporate sudo into the SP-CLEAR command  in the program in order to delete occasional protected print jobs, but this is no longer working.



    ------------------------------
    Warren Moriarity
    IT Manager
    Rocket Forum Shared Account
    ------------------------------



  • 7.  RE: Using sudo in jBase programs

    ROCKETEER
    Posted 03-27-2023 14:26

    Warren,

    There appears to be more to this than can be covered in the forum.

    Please submit a support case to zs-support@rocketsoftware.com.

    Along with the support case, please run "jdiag -dvL" in the problem account and send the resulting "jdiag.out" as an attachment.

    Also, it would help to have a listing of the folder for the problem for queue in "jobs".

    Mike



    ------------------------------
    Mike Street
    Technical Support Engineer
    Rocket Internal - All Brands
    ------------------------------



  • 8.  RE: Using sudo in jBase programs

    Posted 03-28-2023 10:50
    Edited by Kathy Larson 03-28-2023 11:35

    Warren,

    You may want to check to see if there was a previous entry in the sudoers file.
    You view/edit this using 'visudo'
    Look for an entry that may need to be updated from jbase4 to jbase5
    Something like
    ''%jbase4 ALL=NOPASSWD:/opt/jbase4/4.2/bin/SP-CLEAR.sh'
    that needs to be updated to something like
    '%jbase5 ALL=NOPASSWD:/opt/jbase5/5.2/bin/SP-CLEAR.sh'

    Adam



    ------------------------------
    Adam Hawk
    Rocket Forum Shared Account
    ------------------------------



  • 9.  RE: Using sudo in jBase programs

    Posted 03-28-2023 17:03

    Thanks Adam. We have no such entry in our sudoers file.



    ------------------------------
    Warren Moriarity
    IT Manager
    Rocket Forum Shared Account
    ------------------------------