[Spacewalk-list] Kickstart post install

Neil Hanlon neil at neilhanlon.com
Wed Mar 30 11:26:16 UTC 2016


Have you ensured that mariadb is running when you're trying to run these 
commands?

This is also something you should be doing with *some* sort of 
configuration management--not a post install script.

> Lachlan Musicman <mailto:datakid at gmail.com>
> Wednesday, March 30, 2016 1:55 AM
>
> In one particular profile, I'll be installing MariaDB.
>
> I'd like to create a db, user, and then secure MariaDB during the 
> post-install stage.
>
> My post install script looks like this:
>
> %post --log /root/ks-post.log.5
> #!/bin/bash
> /usr/bin/mysql -e "create database slurmdb; grant all privileges on 
> slurmdb.* to slurm at localhost identified by 'slurmdb_password';"
> /usr/bin/mysql <<-EOF
> UPDATE mysql.user SET Password=PASSWORD('mysqlpassword') WHERE 
> User='root';
> DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', 
> '127.0.0.1', '::1');
> DELETE FROM mysql.user WHERE User='';
> DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%';
> FLUSH PRIVILEGES;
> EOF
> %end
>
> But it's not working - neither the database being created or mysql 
> being secured.
>
> Is my syntax wrong, am I over reaching?
>
> L.
>
>
>
> ------
> The most dangerous phrase in the language is, "We've always done it 
> this way."
>
> - Grace Hopper
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list

-- 
Sent from Postbox 
<https://www.postbox-inc.com/?utm_source=email&utm_medium=siglink&utm_campaign=reach>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20160330/328bc3af/attachment.htm>


More information about the Spacewalk-list mailing list