Skip to content

Commit

Permalink
fix mariadb service
Browse files Browse the repository at this point in the history
fix mariadb service

fix mariadb service

fix mariadb service

fix mariadb service

fix mariadb service

fix mariadb service

fix mariadb service

fix mariadb service
  • Loading branch information
tsirysndr committed Jul 12, 2024
1 parent 084a998 commit eb51357
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions mariadb/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ pub fn setup() -> Result<String, Error> {
"flox", "install", "mariadb", "overmind", "tmux"
])?
.with_exec(vec!["[ -d $MYSQL_DATADIR ] || mkdir -p $MYSQL_DATADIR"])?
.with_exec(vec!["[ -f $MYSQL_DATADIR/ca.pem ] || flox activate -- mysql_install_db --auth-root-authentication-method=normal --datadir=$MYSQL_DATADIR --pid-file=$MYSQL_HOME/mysql.pid"])?
.with_exec(vec!["touch ~/.my.cnf"])?
.with_exec(vec!["[ -d $MYSQL_DATADIR/sys ] || flox activate -- mysql_install_db --auth-root-authentication-method=normal --user=`whoami` --datadir=$MYSQL_DATADIR --pid-file=$MYSQL_HOME/mysql.pid --defaults-file=~/.my.cnf"])?
.with_exec(vec![
"grep -q mariadb Procfile || echo 'mariadb: mysqld --datadir=$MYSQL_DATADIR --log-error=$MYSQL_HOME/mysql.log --port=$MYSQL_PORT --socket=$MYSQL_HOME/mysql.socket' >> Procfile",
"grep -q mariadb Procfile || echo 'mariadb: mysqld --datadir=$MYSQL_DATADIR --log-error=$MYSQL_HOME/mysql.log --port=$MYSQL_PORT --socket=$MYSQL_HOME/mysql.socket --defaults-file=$HOME/.my.cnf' >> Procfile",
])?
.stdout()?;

Expand Down
2 changes: 1 addition & 1 deletion mariadb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn start(_args: String) -> FnResult<String> {
.with_exec(vec!["type", "mysql"])?
.with_exec(vec!["echo -e \"MySQL starting on port $MYSQL_PORT\""])?
.with_exec(vec!["overmind", "start", "-f", "Procfile", "--daemonize"])?
.with_exec(vec!["sleep", "2"])?
.wait_on(port.parse()?, None)?
.with_exec(vec!["cat", "$MYSQL_HOME/mysql.log"])?
.with_exec(vec!["overmind", "status"])?
.wait_on(port.parse()?, None)?
Expand Down
3 changes: 1 addition & 2 deletions mysql/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ pub fn start(_args: String) -> FnResult<String> {
.with_exec(vec!["type", "mysql"])?
.with_exec(vec!["echo -e \"MySQL starting on port $MYSQL_PORT\""])?
.with_exec(vec!["overmind", "start", "-f", "Procfile", "--daemonize"])?
.with_exec(vec!["sleep", "2"])?
.wait_on(port.parse()?, None)?
.with_exec(vec!["cat", "$MYSQL_HOME/mysql.log"])?
.with_exec(vec!["overmind", "status"])?
.wait_on(port.parse()?, None)?
.stdout()?;
Ok(stdout)
}
Expand Down

0 comments on commit eb51357

Please sign in to comment.