* [Buildroot] Another lame user question. @ 2016-03-14 5:14 Steve Calfee 2016-03-14 5:36 ` Baruch Siach 0 siblings, 1 reply; 6+ messages in thread From: Steve Calfee @ 2016-03-14 5:14 UTC (permalink / raw) To: buildroot Hi, as the title says, I have another user question. I did explore google and the buildroot docs. I am trying to move the mysql directories to my writeable ubi partition. Somewhere someone create the mysql user. Where did it get created? However, there is no mysql group. I cannot get mysql to start from a ubi partition mounted at /data/mysql. Who and where is the mysql user created (some files have that as a user) The buildroot manual documents the makeusers syntax, but what file do I create where? Will that work for mysql? Thanks, Steve ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] Another lame user question. 2016-03-14 5:14 [Buildroot] Another lame user question Steve Calfee @ 2016-03-14 5:36 ` Baruch Siach 2016-03-14 17:45 ` Steve Calfee 0 siblings, 1 reply; 6+ messages in thread From: Baruch Siach @ 2016-03-14 5:36 UTC (permalink / raw) To: buildroot Hi Steve, On Sun, Mar 13, 2016 at 10:14:57PM -0700, Steve Calfee wrote: > Hi, as the title says, I have another user question. I did explore > google and the buildroot docs. > > I am trying to move the mysql directories to my writeable ubi > partition. Somewhere someone create the mysql user. Where did it get > created? However, there is no mysql group. I cannot get mysql to start > from a ubi partition mounted at /data/mysql. Who and where is the > mysql user created (some files have that as a user) > > The buildroot manual documents the makeusers syntax, but what file do > I create where? Will that work for mysql? Quoting package/mysql/mysql.mk: define MYSQL_USERS mysql -1 nogroup -1 * /var/mysql - - MySQL daemon endef baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] Another lame user question. 2016-03-14 5:36 ` Baruch Siach @ 2016-03-14 17:45 ` Steve Calfee 2016-03-15 22:06 ` Yann E. MORIN 2016-03-15 22:09 ` Samuel Martin 0 siblings, 2 replies; 6+ messages in thread From: Steve Calfee @ 2016-03-14 17:45 UTC (permalink / raw) To: buildroot On Sun, Mar 13, 2016 at 10:36 PM, Baruch Siach <baruch@tkos.co.il> wrote: > Hi Steve, > > On Sun, Mar 13, 2016 at 10:14:57PM -0700, Steve Calfee wrote: >> Hi, as the title says, I have another user question. I did explore >> google and the buildroot docs. >> >> I am trying to move the mysql directories to my writeable ubi >> partition. Somewhere someone create the mysql user. Where did it get >> created? However, there is no mysql group. I cannot get mysql to start >> from a ubi partition mounted at /data/mysql. Who and where is the >> mysql user created (some files have that as a user) >> >> The buildroot manual documents the makeusers syntax, but what file do >> I create where? Will that work for mysql? > > Quoting package/mysql/mysql.mk: > > define MYSQL_USERS > mysql -1 nogroup -1 * /var/mysql - - MySQL daemon > endef > > baruch > Hi Baruch, thanks. So somewhere in the infra a script goes through all *_USERS variables and builds the password file etc for users? What if I want to move /var/mysql? Who uses /var/mysql as the "home" directory? And how does that relate to datadir that is defined in my.cnf? Anyway finding out that the user is created in the make file will really help me research this problem of setting up mysql and moving its datadir to another ubi partition. Thanks, Steve ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] Another lame user question. 2016-03-14 17:45 ` Steve Calfee @ 2016-03-15 22:06 ` Yann E. MORIN 2016-03-15 22:09 ` Samuel Martin 1 sibling, 0 replies; 6+ messages in thread From: Yann E. MORIN @ 2016-03-15 22:06 UTC (permalink / raw) To: buildroot Steve, All, On 2016-03-14 10:45 -0700, Steve Calfee spake thusly: > On Sun, Mar 13, 2016 at 10:36 PM, Baruch Siach <baruch@tkos.co.il> wrote: > > On Sun, Mar 13, 2016 at 10:14:57PM -0700, Steve Calfee wrote: > >> Hi, as the title says, I have another user question. I did explore > >> google and the buildroot docs. > >> > >> I am trying to move the mysql directories to my writeable ubi > >> partition. Somewhere someone create the mysql user. Where did it get > >> created? However, there is no mysql group. I cannot get mysql to start > >> from a ubi partition mounted at /data/mysql. Who and where is the > >> mysql user created (some files have that as a user) > >> > >> The buildroot manual documents the makeusers syntax, but what file do > >> I create where? Will that work for mysql? > > > > Quoting package/mysql/mysql.mk: > > > > define MYSQL_USERS > > mysql -1 nogroup -1 * /var/mysql - - MySQL daemon > > endef > > So somewhere in the infra a script goes through all *_USERS variables > and builds the password file etc for users? See fs/common.mk at 82: 81 ifneq ($$(ROOTFS_USERS_TABLES),) 82 cat $$(ROOTFS_USERS_TABLES) >> $$(USERS_TABLE) 83 endif This is then used by support/scripts/mkusers to fill in /etc/passwd, /etc/groups and their shadow counterparts. > What if I want to move /var/mysql? Who uses /var/mysql as the "home" > directory? And how does that relate to datadir that is defined in > my.cnf? I don;t know mysql, but I get that my.cnf is the configuration file for mysql. If that;s the case, then you should set some variable(s) in my.cnf to point to /var/mysql; I guess you probably want something like datadir=/var/mysql . > Anyway finding out that the user is created in the make file will > really help me research this problem of setting up mysql and moving > its datadir to another ubi partition. Well, you can always have that ubi partition mounted as /var/mysql no? Regards, Yann E. MORIN. > Thanks, Steve > _______________________________________________ > buildroot mailing list > buildroot at busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] Another lame user question. 2016-03-14 17:45 ` Steve Calfee 2016-03-15 22:06 ` Yann E. MORIN @ 2016-03-15 22:09 ` Samuel Martin 2016-03-15 23:58 ` Steve Calfee 1 sibling, 1 reply; 6+ messages in thread From: Samuel Martin @ 2016-03-15 22:09 UTC (permalink / raw) To: buildroot On Mon, Mar 14, 2016 at 6:45 PM, Steve Calfee <stevecalfee@gmail.com> wrote: > On Sun, Mar 13, 2016 at 10:36 PM, Baruch Siach <baruch@tkos.co.il> wrote: >> Hi Steve, >> >> On Sun, Mar 13, 2016 at 10:14:57PM -0700, Steve Calfee wrote: >>> Hi, as the title says, I have another user question. I did explore >>> google and the buildroot docs. >>> >>> I am trying to move the mysql directories to my writeable ubi >>> partition. Somewhere someone create the mysql user. Where did it get >>> created? However, there is no mysql group. I cannot get mysql to start >>> from a ubi partition mounted at /data/mysql. Who and where is the >>> mysql user created (some files have that as a user) >>> >>> The buildroot manual documents the makeusers syntax, but what file do >>> I create where? Will that work for mysql? >> >> Quoting package/mysql/mysql.mk: >> >> define MYSQL_USERS >> mysql -1 nogroup -1 * /var/mysql - - MySQL daemon >> endef >> >> baruch >> > Hi Baruch, thanks. > > So somewhere in the infra a script goes through all *_USERS variables > and builds the password file etc for users? Yes, see [1, 2]. > > What if I want to move /var/mysql? As long as mysql binaries and configuration files are kept in sync, it is possible. But the proper way to do this is changing this in the configure options (see [3]). > Who uses /var/mysql as the "home" directory? Check the etc/passwd file from your target filesystem, but in grepping mainline Buildroot source will tell you that no-one but mysql user is using /var/mysql (as Baruch already said)... > And how does that relate to datadir that is defined in my.cnf? You may want to check this [3]. Don't know much about mysql, but I guess /var/mysql is driven by the localstatedir option. Take some time to learn what does each option, but tweaking this certainly means patching the Buildroot's mysql.mk file. > > Anyway finding out that the user is created in the make file will > really help me research this problem of setting up mysql and moving > its datadir to another ubi partition. > > Thanks, Steve > _______________________________________________ > buildroot mailing list > buildroot at busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot [1] https://buildroot.org/downloads/manual/manual.html#generic-package-reference [2] https://buildroot.org/downloads/manual/manual.html#makeuser-syntax [3] http://dev.mysql.com/doc/refman/5.1/en/source-configuration-options.html Regards, -- Samuel ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] Another lame user question. 2016-03-15 22:09 ` Samuel Martin @ 2016-03-15 23:58 ` Steve Calfee 0 siblings, 0 replies; 6+ messages in thread From: Steve Calfee @ 2016-03-15 23:58 UTC (permalink / raw) To: buildroot Thanks for the tips. The user/group thing was a wild goose chase from other internet users trying to get mysql to work. I got mysql relocated. But still a mystery is how it SHOULD be done. There are two files involved in configuring it. The /etc/init.d/S97mysql starts/stops the service, but also passes some command line args: #!/bin/sh case "$1" in start) if [ ! -d /data/mysql/mysql ] ; then echo "Creating MySQL system tables..." mysql_install_db --user=mysql --ldata=/data/mysql fi # mysqld runs as user mysql, but /run is only writable by root # so create a subdirectory for mysql. install -d -o mysql -g root -m 0700 /data/mysql # We don't use start-stop-daemon because mysqld has # its own wrapper script. printf "Starting mysql..." /usr/bin/mysqld_safe --pid-file=/data/mysql/mysqld.pid & echo "done." ;; stop) printf "Stopping mysql..." if test -f /data/mysql/mysqld.pid ; then kill `cat /data/mysql/mysqld.pid` fi echo "done." ;; restart) $0 stop $0 start ;; *) echo "Usage: /etc/init.d/mysqld {start|stop|restart}" ;; esac and the important parts of my.cnf # The following options will be passed to all MySQL clients [client] #password = your_password port = 3306 socket = /data/mysql/mysqld.sock # Here follows entries for some specific programs # The MySQL server [mysqld] port = 3306 socket = /data/mysql/mysqld.sock skip-locking key_buffer_size = 256M max_allowed_packet = 1M table_open_cache = 256 sort_buffer_size = 1M read_buffer_size = 1M read_rnd_buffer_size = 4M myisam_sort_buffer_size = 64M thread_cache_size = 8 query_cache_size= 16M # Try number of CPU's*2 for thread_concurrency thread_concurrency = 2 #dockstar data directory on r/w ubi partition. datadir=/data/mysql When I aligned these two files I could relocate the mysql data and pid storage. But I don't know if I need all this redundant info or not. When I get over my next unrelated hurdle I will come back and remove one thing at a time and see what is needed and what isn't. Thanks for the tips, Steve ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-03-15 23:58 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-03-14 5:14 [Buildroot] Another lame user question Steve Calfee 2016-03-14 5:36 ` Baruch Siach 2016-03-14 17:45 ` Steve Calfee 2016-03-15 22:06 ` Yann E. MORIN 2016-03-15 22:09 ` Samuel Martin 2016-03-15 23:58 ` Steve Calfee
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox