diff options
author | Kyle Kaminski <kyle@xenomedia.com> | 2014-08-27 18:40:08 -0500 |
---|---|---|
committer | Kyle Kaminski <kyle@xenomedia.com> | 2014-08-27 18:40:08 -0500 |
commit | 5be4eff6bf8739ce613921886c3dddb4088d03fb (patch) | |
tree | eda6de2f59346444bd68e3001b53d5265e77bf75 | |
parent | 6ae7ecf02379eac1d159858c20654b4956a097d7 (diff) | |
download | configs-5be4eff6bf8739ce613921886c3dddb4088d03fb.tar.gz configs-5be4eff6bf8739ce613921886c3dddb4088d03fb.tar.bz2 configs-5be4eff6bf8739ce613921886c3dddb4088d03fb.zip |
document LAMP stack on archlinux fused to macosx's partition
-rw-r--r-- | bashrc | 3 | ||||
-rw-r--r-- | macbook/local.service | 7 | ||||
-rw-r--r-- | macbook/macosx.txt | 15 | ||||
-rw-r--r-- | systemd-local-cmds/etc/systemd/system/local.service | 13 | ||||
-rw-r--r-- | systemd-local-cmds/etc/systemd/system/mysqld.service | 18 | ||||
-rw-r--r-- | systemd-local-cmds/mysqld.service | 18 | ||||
-rw-r--r-- | systemd-local-cmds/notes.txt | 2 | ||||
-rwxr-xr-x | systemd-local-cmds/usr/bin/local.sh | 4 |
8 files changed, 77 insertions, 3 deletions
@@ -4,3 +4,6 @@ PS1='\[\e[1;37m\][\[\e[m\]\[\e[1;32m\]\u\[\e[m\]@\[\e[1;37m\]\h\[\e[m\] \[\e[1;3 [root] PS1='\[\e[1;37m\][\[\e[m\]\[\e[1;31m\]\u\[\e[m\]@\[\e[1;37m\]\h\[\e[m\] \[\e[1;36m\]\w\[\e[m\]\[\e[1;37m\]]\[\e[m\]\[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]' +[user git branch] +PS1='\[\e[1;37m\][\[\e[m\]\[\e[1;32m\]\u\[\e[m\]@\[\e[1;37m\]\h\[\e[m\] \[\e[1;36m\]\w\[\e[m\]\[\e[1;33m\]$(__git_ps1 " (%s)")\[\e[m\]\[\e[1;37m\]]\[\e[m\]\[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]' + diff --git a/macbook/local.service b/macbook/local.service index ddf2555..bf4fba0 100644 --- a/macbook/local.service +++ b/macbook/local.service @@ -1,10 +1,13 @@ -# place to /etc/systemd/system/local.service - [Unit] Description=Run local commands after boot +ConditionFileIsExecutable=/usr/bin/local.sh [Service] +Type=oneshot +# below is needed otherwise ExecStop would execute right after start and unmount +RemainAfterExit=Yes ExecStart=/usr/bin/local.sh +ExecStop=/usr/bin/umount /mnt/mac-bind [Install] WantedBy=multi-user.target diff --git a/macbook/macosx.txt b/macbook/macosx.txt index 618cd3f..c799568 100644 --- a/macbook/macosx.txt +++ b/macbook/macosx.txt @@ -1,2 +1,15 @@ - let the env know about 'port' packages, here we care about include dir -CFLAGS=-I/opt/local/include ./configure
\ No newline at end of file +CFLAGS=-I/opt/local/include ./configure + +[arch setup] +- perms + -> http and git users/accounts are added to users group + -> 775 is used now for all website dirs + -> rest of the system uses kyle:users and 644 perms such as text editor, IDE, etc. + +- lamp stack + -> macosx's partition is used to store mysql db + -> mysqld.service has to be modified and --datadir= argument was added + -> custom local.service start before mysql end stop after mysql to mount + masqueraded/mapped user:group perms from macosx's system to archlinux + diff --git a/systemd-local-cmds/etc/systemd/system/local.service b/systemd-local-cmds/etc/systemd/system/local.service new file mode 100644 index 0000000..bf4fba0 --- /dev/null +++ b/systemd-local-cmds/etc/systemd/system/local.service @@ -0,0 +1,13 @@ +[Unit] +Description=Run local commands after boot +ConditionFileIsExecutable=/usr/bin/local.sh + +[Service] +Type=oneshot +# below is needed otherwise ExecStop would execute right after start and unmount +RemainAfterExit=Yes +ExecStart=/usr/bin/local.sh +ExecStop=/usr/bin/umount /mnt/mac-bind + +[Install] +WantedBy=multi-user.target diff --git a/systemd-local-cmds/etc/systemd/system/mysqld.service b/systemd-local-cmds/etc/systemd/system/mysqld.service new file mode 100644 index 0000000..c1f8d3b --- /dev/null +++ b/systemd-local-cmds/etc/systemd/system/mysqld.service @@ -0,0 +1,18 @@ +[Unit] +Description=MariaDB database server +After=syslog.target +Requires=local.service +After=local.service + +[Service] +User=mysql +Group=mysql + +ExecStart=/usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid --datadir=/home/kyle/dev/mysql +ExecStartPost=/usr/bin/mysqld-post + +Restart=always +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/systemd-local-cmds/mysqld.service b/systemd-local-cmds/mysqld.service new file mode 100644 index 0000000..c1f8d3b --- /dev/null +++ b/systemd-local-cmds/mysqld.service @@ -0,0 +1,18 @@ +[Unit] +Description=MariaDB database server +After=syslog.target +Requires=local.service +After=local.service + +[Service] +User=mysql +Group=mysql + +ExecStart=/usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid --datadir=/home/kyle/dev/mysql +ExecStartPost=/usr/bin/mysqld-post + +Restart=always +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/systemd-local-cmds/notes.txt b/systemd-local-cmds/notes.txt new file mode 100644 index 0000000..1cfd4bc --- /dev/null +++ b/systemd-local-cmds/notes.txt @@ -0,0 +1,2 @@ +- what i'm trying to accomplish here is to mount a disk before mysqld starts + and unmount it after mysqld stops diff --git a/systemd-local-cmds/usr/bin/local.sh b/systemd-local-cmds/usr/bin/local.sh new file mode 100755 index 0000000..84941b9 --- /dev/null +++ b/systemd-local-cmds/usr/bin/local.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +/usr/bin/bindfs --map=502/1000:@20/@100,@70/@33 /mnt/mac /mnt/mac-bind + |