Professional Web Applications Themes

script_as_non_root - Sun Solaris

Hallo, I want to start mysql-daemon with a script /etc/rc3.d/S99mysql (OS Solaris 9) while booting. It is recommanded to start the mysql-daemon not as root, but as (par example) user mysql. How can I do that ? Thank you for reading and, in advance, answering ! regards Heiner...

  1. #1

    Default script_as_non_root


    Hallo,


    I want to start mysql-daemon with a script /etc/rc3.d/S99mysql (OS Solaris 9) while booting.

    It is recommanded to start the mysql-daemon not as root, but as (par example)
    user mysql.

    How can I do that ?

    Thank you for reading and, in advance, answering !


    regards Heiner

    Heiner_Kotula Guest

  2. #2

    Default Re: script_as_non_root

    Heiner_Kotula <de> wrote: 

    Use "su" in the startup script, something like:

    su $MYSQLUSER -c "/path/to/mysqldaemon"

    mp.
    --
    Systems Administrator | Institute for Software Science | Univ. of Vienna
    Martin Guest

  3. #3

    Default Re: script_as_non_root

    Thank you Martin Paul,


    ***********************************************
    Use "su" in the startup script, something like:

    su $MYSQLUSER -c "/path/to/mysqldaemon"
    ***********************************************

    it works!


    regards Heiner

    Heiner_Kotula Guest

  4. #4

    Default Re: script_as_non_root

    Heiner_Kotula wrote: 


    Although the advice given elsewhere in the thread is good, I was
    wondering why you don't use the mysql.server script which is
    specifically supplied with the mysql distribution instead of rolling
    your own startup script. This fires up a script called mysqld_safe
    within the mysql directory tree - mysql_safe takes care of changing to
    the mysql user and so on for you.

    --
    Tony

    Tony Guest

  5. #5

    Default Re: script_as_non_root

    On Tue, 07 Oct 2003 13:47:49 +0100, Tony Walton <com> wrote: 
    >
    >
    > Although the advice given elsewhere in the thread is good, I was
    > wondering why you don't use the mysql.server script which is
    > specifically supplied with the mysql distribution instead of rolling
    > your own startup script. This fires up a script called mysqld_safe
    > within the mysql directory tree - mysql_safe takes care of changing to
    > the mysql user and so on for you.
    >[/ref]

    Exactly my advice, copy the script to /etc/init.d/mysql
    create the symlinks

    and....

    create a /etc/my.cnf file with this contents:

    [mysqld]
    user=mysql

    Note, you may need more in there, read the doentation, but this line
    will start mysqld as user mysql

    Taco
    Taco Guest

  6. #6

    Default Re: script_as_non_root

    Taco R. de Vries wrote:
     


    I may be misreading the script, but it seems to me that you don't even
    need to do that. If you're running mysqld_safe as root (which you will
    be doing if you run the mysql.server script from init.d), it will
    default to starting the daemon as "mysql" if you don't tell it otherwise.

    This is mysql 4.0.14, in case that makes a difference.

    --
    Tony

    Tony Guest

  7. #7

    Default Re: script_as_non_root

    On Tue, 07 Oct 2003 16:12:24 +0100, Tony Walton <com> wrote: 
    >
    >
    > I may be misreading the script, but it seems to me that you don't even
    > need to do that. If you're running mysqld_safe as root (which you will
    > be doing if you run the mysql.server script from init.d), it will
    > default to starting the daemon as "mysql" if you don't tell it otherwise.
    >
    > This is mysql 4.0.14, in case that makes a difference.
    >[/ref]

    Yep you are right about that, although the script is not exactly readable
    I just tried without the /etc/my.conf and the daemon starts as mysql.

    Taco
    Taco Guest

  8. #8

    Default Re: script_as_non_root


    "Heiner_Kotula" <DE> wrote in message
    news:bltv8d$sdt$rz.tu-ilmenau.de... 
    9) while booting. 
    example) 


    george Guest

  9. #9

    Default Re: script_as_non_root

    From the man page for su there is
    example% su - bin -c "command args"
    Also here is how Oracle starts up from a startup script :-
    su - $ORA_OWNER -c $ORA_HOME/bin/dbstart

    George

    "Heiner_Kotula" <DE> wrote in message
    news:bltv8d$sdt$rz.tu-ilmenau.de... 
    9) while booting. 
    example) 


    george Guest

  10. #10

    Default Re: script_as_non_root


    Hallo,



    when I start the script mysql.server, without any changes, the daemon runs as "mysql".

    It's mysql 2.23.58.

    I was mistaken.

    Thank you !


    regards Heiner




    Heiner_Kotula Guest

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139