Find the answer to your Linux question:
Results 1 to 7 of 7
I can not sudo, it MUST be root to start the needed services Here are the commands I have a script executing: ./opt/WebSphere/AppServer/bin/startServer.sh server1 ####### ./opt/WebSphere/AppServer/bin/startServer.sh icmrm ###### ./opt/WebSphere/AppServer/bin/startServer.sh eClient_Server ...
  1. #1
    Linux Newbie
    Join Date
    Jun 2006
    Posts
    139

    Need to set root env in a script

    I can not sudo, it MUST be root to start the needed services
    Here are the commands I have a script executing:
    ./opt/WebSphere/AppServer/bin/startServer.sh server1
    #######
    ./opt/WebSphere/AppServer/bin/startServer.sh icmrm
    ######
    ./opt/WebSphere/AppServer/bin/startServer.sh eClient_Server
    #
    #####
    ./etc/rc.cmrmproc -act start
    ####
    ./opt/IBMHttpServer/bin/apachectl restart

    I keep getting
    No such file or directory evertime I execute.
    This is driving me batty
    thanks
    Mace

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    If you're getting an error message, that it's possible for this script to send output to the screen.

    So sprinkle unique echo statements through the script, like this:
    Code:
    /bin/echo xxx1
    ./opt/WebSphere/AppServer/bin/startServer.sh server1
    /bin/echo xxx2
    #######
    ./opt/WebSphere/AppServer/bin/startServer.sh icmrm
    /bin/echo xxx3
    ######
    ./opt/WebSphere/AppServer/bin/startServer.sh eClient_Server
    /bin/echo xxx4
    #
    #####
    ./etc/rc.cmrmproc -act start
    /bin/echo xxx5
    ####
    ./opt/IBMHttpServer/bin/apachectl restart
    /bin/echo xxx6
    If you never see any of those xxx messages, you know it's probably the script itself that can't be found.

    If you see the xxx messages, you can tell which command in that script is being executed when the error message occurs.

    Hope this gets you on the right track.

  3. #3
    Linux Newbie
    Join Date
    Jun 2006
    Posts
    139
    I'll do that, I forgot to mention that this is run through cron. I can execute the scripts manually as root and it works but cron is killing me
    thanks
    Mace

  4. #4
    Linux Newbie
    Join Date
    Jun 2006
    Posts
    139
    results are:
    xxx2
    /opt/scripts/cmsanddb2up.sh: line 6: ./opt/WebSphere/AppServer/bin/startServer.sh: No such file or directory
    xxx3
    /opt/scripts/cmsanddb2up.sh: line 9: ./opt/WebSphere/AppServer/bin/startServer.sh: No such file or directory
    xxx4
    /opt/scripts/cmsanddb2up.sh: line 12: ./opt/WebSphere/AppServer/bin/startServer.sh: No such file or directory
    xxx5
    /opt/scripts/cmsanddb2up.sh: line 15: ./etc/rc.cmrmproc: No such file or directory
    xxx6
    /opt/scripts/cmsanddb2up.sh: line 18: ./opt/IBMHttpServer/bin/apachectl: No such file or directory
    FYI cmsanddb2.sh is started by a script where I tried to su to root, it looks like this:
    su root -c /opt/scripts/cmsanddb2up.sh

    thanks
    Mace

  5. #5
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Code:
    ./opt/WebSphere/AppServer/bin/startServer.sh server1
    #######
    ./opt/WebSphere/AppServer/bin/startServer.sh icmrm
    ######
    ./opt/WebSphere/AppServer/bin/startServer.sh eClient_Server
    #
    #####
    ./etc/rc.cmrmproc -act start
    What are those periods doing in there?

    They indicate that these files are relative to your current directory. But you have no current directory while you're in a cron job. So you need to spell out the full path names, starting with /.

    Unless you know otherwise, you should probably remove those periods.

  6. #6
    Linux Newbie
    Join Date
    Jun 2006
    Posts
    139
    removing the period worked the services "came" up but we are still unable to access db2 from the was server frontend. we can get to db2 through a backdoor , so it isn't db2 having the problem.
    If I bring everthing down and run the script from a command line as root it will work

    thanks
    Mace

  7. #7
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    we are still unable to access db2 from the was server frontend
    What happens when you try? What error messages do you get? Don't paraphrase the messages; copy and paste into a reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...