<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Przemoc</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Przemoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Przemoc"/>
	<updated>2026-05-04T00:34:30Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=19755</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=19755"/>
		<updated>2021-07-02T11:58:10Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Fix mailing list links (sourcehut-based).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I wanted to do and did before AL 3.4 release and some fixing done afterwards.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Pre-install/upgrade scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Improvements ===&lt;br /&gt;
&lt;br /&gt;
==== Make all packages create only &#039;&#039;system&#039;&#039; users and groups ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. [2016-04-25]&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [https://lists.alpinelinux.org/~alpine/aports/patches/2713 Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches) [2016-04-23]&lt;br /&gt;
&lt;br /&gt;
=== Corrections ===&lt;br /&gt;
&lt;br /&gt;
==== Fix problems introduced by adding -S to adduser ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group.                       [2016-06-03]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install.                 [2016-06-07]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install.               [2016-06-07]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install.      [2016-06-07]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts.      [2016-06-07]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. [2016-06-07]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts.   [2016-06-07]&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [https://lists.alpinelinux.org/~alpine/aports/patches/928 Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches) [2016-06-06]&lt;br /&gt;
&lt;br /&gt;
Patches for main and community are already cherry-picked in 3.4-stable branch as of 2016-06-20.&lt;br /&gt;
&lt;br /&gt;
Following packages were overlooked before:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;br /&gt;
&lt;br /&gt;
My commit fixing them is:&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=94e0b0631f37 94e0b0631f37] testing/[various]: Add group and use it as primary in .pre-* scripts. [2016-06-20]&lt;br /&gt;
&lt;br /&gt;
It is part of patch set:&lt;br /&gt;
* [https://lists.alpinelinux.org/~alpine/aports/patches/994 Forgotten pre-install addgroup/adduser fixes and fixes.] (5 patches) [2016-06-17]&lt;br /&gt;
&lt;br /&gt;
==== Fix problems for those who already installed above mentioned packages in Alpine Linux 3.4.0  ====&lt;br /&gt;
&lt;br /&gt;
Fixes in previous sections work only for people that haven&#039;t installed above mentioned packages within Alpine Linux 3.4.0.&lt;br /&gt;
Even package removal and reinstallation is not enough, because old entries in &amp;lt;code&amp;gt;/etc/passwd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/group&amp;lt;/code&amp;gt; remain.&lt;br /&gt;
You can remove these old entries before reinstallation using &amp;lt;code&amp;gt;deluser&amp;lt;/code&amp;gt;, but before that you have to find all the files owned by that user (&amp;lt;code&amp;gt;find / -user NAME&amp;lt;/code&amp;gt;) to fix ownership after package reinstallation, as group id will change and user id may change.&lt;br /&gt;
&lt;br /&gt;
We cannot and shouldn&#039;t do such invasive changes in automatic way during upgrade.&lt;br /&gt;
&lt;br /&gt;
I wanted to at least add missing groups and add users to them via upgrades in AL 3.4. (Mind that such users&#039;s primary group will not be changed either, i.e. from &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, because user could have changed it on her/his own.) But there wasn&#039;t much interest, even though I provided some patches, like for below examples (so called AL 3.4 band-aids for ccc056dbf9d3 in .pre-* script).&lt;br /&gt;
&lt;br /&gt;
Examples of known problems for people upgrading from Alpine Linux 3.4.0:&lt;br /&gt;
&lt;br /&gt;
* main/apache2: No &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; group. (Default config uses &amp;lt;code&amp;gt;apache:apache&amp;lt;/code&amp;gt;, so daemon won&#039;t start.)&lt;br /&gt;
* main/lighttpd: No &amp;lt;code&amp;gt;lighttpd&amp;lt;/code&amp;gt; group.&lt;br /&gt;
&lt;br /&gt;
I consider this topic in the context of AL 3.4 closed.&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=19754</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=19754"/>
		<updated>2021-07-02T10:06:41Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Provide dates next to commits in square brackets.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I wanted to do and did before AL 3.4 release and some fixing done afterwards.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Pre-install/upgrade scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Improvements ===&lt;br /&gt;
&lt;br /&gt;
==== Make all packages create only &#039;&#039;system&#039;&#039; users and groups ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. [2016-04-25]&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
=== Corrections ===&lt;br /&gt;
&lt;br /&gt;
==== Fix problems introduced by adding -S to adduser ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group.                       [2016-06-03]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install.                 [2016-06-07]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install.               [2016-06-07]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install.      [2016-06-07]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts.      [2016-06-07]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. [2016-06-07]&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts.   [2016-06-07]&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches)&lt;br /&gt;
&lt;br /&gt;
Patches for main and community are already cherry-picked in 3.4-stable branch as of 2016-06-20.&lt;br /&gt;
&lt;br /&gt;
Following packages were overlooked before:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;br /&gt;
&lt;br /&gt;
My commit fixing them is:&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=94e0b0631f37 94e0b0631f37] testing/[various]: Add group and use it as primary in .pre-* scripts. [2016-06-20]&lt;br /&gt;
&lt;br /&gt;
It is part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3109.html Forgotten pre-install addgroup/adduser fixes and fixes.] (5 patches)&lt;br /&gt;
&lt;br /&gt;
==== Fix problems for those who already installed above mentioned packages in Alpine Linux 3.4.0  ====&lt;br /&gt;
&lt;br /&gt;
Fixes in previous sections work only for people that haven&#039;t installed above mentioned packages within Alpine Linux 3.4.0.&lt;br /&gt;
Even package removal and reinstallation is not enough, because old entries in &amp;lt;code&amp;gt;/etc/passwd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/group&amp;lt;/code&amp;gt; remain.&lt;br /&gt;
You can remove these old entries before reinstallation using &amp;lt;code&amp;gt;deluser&amp;lt;/code&amp;gt;, but before that you have to find all the files owned by that user (&amp;lt;code&amp;gt;find / -user NAME&amp;lt;/code&amp;gt;) to fix ownership after package reinstallation, as group id will change and user id may change.&lt;br /&gt;
&lt;br /&gt;
We cannot and shouldn&#039;t do such invasive changes in automatic way during upgrade.&lt;br /&gt;
&lt;br /&gt;
I wanted to at least add missing groups and add users to them via upgrades in AL 3.4. (Mind that such users&#039;s primary group will not be changed either, i.e. from &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, because user could have changed it on her/his own.) But there wasn&#039;t much interest, even though I provided some patches, like for below examples (so called AL 3.4 band-aids for ccc056dbf9d3 in .pre-* script).&lt;br /&gt;
&lt;br /&gt;
Examples of known problems for people upgrading from Alpine Linux 3.4.0:&lt;br /&gt;
&lt;br /&gt;
* main/apache2: No &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; group. (Default config uses &amp;lt;code&amp;gt;apache:apache&amp;lt;/code&amp;gt;, so daemon won&#039;t start.)&lt;br /&gt;
* main/lighttpd: No &amp;lt;code&amp;gt;lighttpd&amp;lt;/code&amp;gt; group.&lt;br /&gt;
&lt;br /&gt;
I consider this topic in the context of AL 3.4 closed.&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=19753</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=19753"/>
		<updated>2021-07-02T10:03:22Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Fix commit links (/cgit/ is no longer in path).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I wanted to do and did before AL 3.4 release and some fixing done afterwards.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Pre-install/upgrade scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Improvements ===&lt;br /&gt;
&lt;br /&gt;
==== Make all packages create only &#039;&#039;system&#039;&#039; users and groups ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
=== Corrections ===&lt;br /&gt;
&lt;br /&gt;
==== Fix problems introduced by adding -S to adduser ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches)&lt;br /&gt;
&lt;br /&gt;
Patches for main and community are already cherry-picked in 3.4-stable branch as of 2016-06-20.&lt;br /&gt;
&lt;br /&gt;
Following packages were overlooked before:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;br /&gt;
&lt;br /&gt;
My commit fixing them is:&lt;br /&gt;
 * [https://git.alpinelinux.org/aports/commit/?id=94e0b0631f37 94e0b0631f37] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-20)&lt;br /&gt;
&lt;br /&gt;
It is part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3109.html Forgotten pre-install addgroup/adduser fixes and fixes.] (5 patches)&lt;br /&gt;
&lt;br /&gt;
==== Fix problems for those who already installed above mentioned packages in Alpine Linux 3.4.0  ====&lt;br /&gt;
&lt;br /&gt;
Fixes in previous sections work only for people that haven&#039;t installed above mentioned packages within Alpine Linux 3.4.0.&lt;br /&gt;
Even package removal and reinstallation is not enough, because old entries in &amp;lt;code&amp;gt;/etc/passwd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/group&amp;lt;/code&amp;gt; remain.&lt;br /&gt;
You can remove these old entries before reinstallation using &amp;lt;code&amp;gt;deluser&amp;lt;/code&amp;gt;, but before that you have to find all the files owned by that user (&amp;lt;code&amp;gt;find / -user NAME&amp;lt;/code&amp;gt;) to fix ownership after package reinstallation, as group id will change and user id may change.&lt;br /&gt;
&lt;br /&gt;
We cannot and shouldn&#039;t do such invasive changes in automatic way during upgrade.&lt;br /&gt;
&lt;br /&gt;
I wanted to at least add missing groups and add users to them via upgrades in AL 3.4. (Mind that such users&#039;s primary group will not be changed either, i.e. from &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, because user could have changed it on her/his own.) But there wasn&#039;t much interest, even though I provided some patches, like for below examples (so called AL 3.4 band-aids for ccc056dbf9d3 in .pre-* script).&lt;br /&gt;
&lt;br /&gt;
Examples of known problems for people upgrading from Alpine Linux 3.4.0:&lt;br /&gt;
&lt;br /&gt;
* main/apache2: No &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; group. (Default config uses &amp;lt;code&amp;gt;apache:apache&amp;lt;/code&amp;gt;, so daemon won&#039;t start.)&lt;br /&gt;
* main/lighttpd: No &amp;lt;code&amp;gt;lighttpd&amp;lt;/code&amp;gt; group.&lt;br /&gt;
&lt;br /&gt;
I consider this topic in the context of AL 3.4 closed.&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image&amp;diff=13551</id>
		<title>How to make a custom ISO image</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_custom_ISO_image&amp;diff=13551"/>
		<updated>2017-05-30T15:31:00Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Add info about sibling page using mkimage.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Obsolete|alpine-iso is deprecated since Alpine 3.5 in favor of mkimage scripts found in root of aports directory. Check also: [[How to make a custom ISO image with mkimage]].}}&lt;br /&gt;
&lt;br /&gt;
This document explains how to build a custom ISO image using the alpine-iso scripts.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
&lt;br /&gt;
First make sure we have the needed tools&lt;br /&gt;
{{Cmd|apk add alpine-sdk xorriso syslinux}}&lt;br /&gt;
&lt;br /&gt;
Then create signing keys (-i installs them in /etc/apk/keys which is required for later)&lt;br /&gt;
{{Cmd|abuild-keygen -i -a}}&lt;br /&gt;
&lt;br /&gt;
Clone (or update) the [http://git.alpinelinux.org/cgit/alpine-iso.git/ alpine-iso git repository].&lt;br /&gt;
{{Cmd|git clone git://git.alpinelinux.org/alpine-iso}}&lt;br /&gt;
&lt;br /&gt;
== Core Configuration ==&lt;br /&gt;
&lt;br /&gt;
The alpine-iso scripts is a simple makefile which you need to feed with a &#039;&#039;&amp;lt;name&amp;gt;.conf.mk&#039;&#039; file and a &#039;&#039;&amp;lt;name&amp;gt;.packages&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
In the &#039;&#039;&amp;lt;name&amp;gt;.conf.mk&#039;&#039; we specify&lt;br /&gt;
&lt;br /&gt;
;ALPINE_NAME&lt;br /&gt;
:name of iso image&lt;br /&gt;
&lt;br /&gt;
;ALPINE_VERSION&lt;br /&gt;
:(optional) version string. Will default to todays date.&lt;br /&gt;
&lt;br /&gt;
;KERNEL_FLAVOR&lt;br /&gt;
:(optional) either &#039;&#039;grsec&#039;&#039;, &#039;&#039;vserver&#039;&#039; or &#039;&#039;pae&#039;&#039;. Will default to grsec.&lt;br /&gt;
&lt;br /&gt;
;MODLOOP_EXTRA&lt;br /&gt;
:(optional) Extra kernel module packages for the modloop image. For example: &#039;&#039;dahdi-linux-vserver&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
;APK_REPOS&lt;br /&gt;
:(optional) Path to addidtional apk repository.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&amp;lt;name&amp;gt;.packages&#039;&#039; is just a plaintext list of packages that should be included in the ISO image. You should always add &#039;&#039;alpine-base&#039;&#039; in there or the CD might not be able to boot. The dependencies for the packages will automatically be pulled in.&lt;br /&gt;
&lt;br /&gt;
== A rescue CD example ==&lt;br /&gt;
As an example, let us make a rescue ISO image with packages needed for rescue operations. We call it &#039;&#039;alpine-rescue&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We create the &#039;&#039;alpine-rescue.conf.mk&#039;&#039; as follows:&lt;br /&gt;
 ALPINE_NAME   := alpine-rescue&lt;br /&gt;
 KERNEL_FLAVOR := grsec&lt;br /&gt;
 MODLOOP_EXTRA :=&lt;br /&gt;
&lt;br /&gt;
If you are going to use a custom kernel, don&#039;t forget to specify KERNEL_FLAVOR_DEFAULT which will set the default kernel to boot.&lt;br /&gt;
&lt;br /&gt;
And then the &#039;&#039;alpine-rescue.packages&#039;&#039; as:&lt;br /&gt;
 alpine-base&lt;br /&gt;
 bkeymaps&lt;br /&gt;
 openssh&lt;br /&gt;
 e2fsprogs&lt;br /&gt;
 mdadm&lt;br /&gt;
 lvm2&lt;br /&gt;
 parted&lt;br /&gt;
 debootstrap&lt;br /&gt;
 ntfs-3g&lt;br /&gt;
&lt;br /&gt;
{{Tip| Make sure your public keys are placed in /etc/apk/keys/ (example: root-xxxxxxxx.rsa.pub):&lt;br /&gt;
{{Cmd|ls /etc/apk/keys/}}&lt;br /&gt;
&lt;br /&gt;
Learn apk-tools to find your home-built apk&#039;s:&lt;br /&gt;
{{Cmd|echo &amp;quot;~/.cache/abuild/&amp;quot; &amp;gt;&amp;gt; /etc/apk/repositories}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Make sure the apk index is up to date (so apk finds the packages):&lt;br /&gt;
{{Cmd|apk update}}&lt;br /&gt;
&lt;br /&gt;
We create the ISO image by telling the makefile the profile name. The makefile target is &#039;&#039;iso&#039;&#039;.&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;make PROFILE=alpine-rescue iso&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Tip| If you are building inside an LXC guest, use fakeroot:&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;fakeroot make PROFILE=alpine-rescue iso&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To generate the sha256 sum we use the &#039;&#039;sha256&#039;&#039; make target.&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;make PROFILE=alpine-rescue sha256&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Package lists ==&lt;br /&gt;
&lt;br /&gt;
Beside the plaintext package lists in the git repository, there are more documented package lists contributed by Alpine users. Those lists can be transformed into a plain text description by &amp;lt;code&amp;gt;apk search --exact -v $(cat alpine.packages)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So far the lists below are available (check [[:Category:ISO|here]] for more.)&lt;br /&gt;
&lt;br /&gt;
* [[Alpine_mini|Alpine Mini]]&lt;br /&gt;
* [[Alpine_rescue|Alpine Rescue]]&lt;br /&gt;
* [[Alpine_security|Alpine Security]]&lt;br /&gt;
* [[Alpine SCST]]&lt;br /&gt;
&lt;br /&gt;
== Live Disk Setup with APKOVL ==&lt;br /&gt;
&lt;br /&gt;
Once you have customized your custom ISO, you can now setup the live environment to operate outside of the standard installer as follows:&lt;br /&gt;
&lt;br /&gt;
* Generate an APKOVL file with [[Alpine_local_backup|lbu]], &amp;lt;code&amp;gt;lbu ci&amp;lt;/code&amp;gt;&lt;br /&gt;
* Alpine ISO requires the OVL Volume to be hosted on a web server. Put the APKOVL file on a webserver and identify the url. &lt;br /&gt;
* Uncomment the &amp;lt;code&amp;gt;APKOVL&amp;lt;/code&amp;gt; line in the alpine flavor of your choice and set it to the address of your ovl volume.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* Any packages you add to /etc/apk/world of your lbu will automatically be installed onto the live system image.&lt;br /&gt;
* If you don&#039;t have a web server you can run busybox&#039;s httpd temporarily - &amp;lt;code&amp;gt;busybox httpd -p 127.0.0.1:80&amp;lt;/code&amp;gt;&lt;br /&gt;
* In general, &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt; will only handle files in &amp;lt;code&amp;gt;/etc&amp;lt;/code&amp;gt;, to customize this further, you need to add additional files.&lt;br /&gt;
* If you want to make a customized installer, you need to create &amp;lt;code&amp;gt;.default_boot_services&amp;lt;/code&amp;gt; which will cause &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; to create the defaults for the live image.&lt;br /&gt;
&lt;br /&gt;
== Testing your ISO image ==&lt;br /&gt;
&lt;br /&gt;
[[Qemu#Live_mode| Qemu]] is useful for a quick test of your created ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:ISO]]&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo&amp;diff=13549</id>
		<title>User:Przemoc/Todo</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo&amp;diff=13549"/>
		<updated>2017-05-30T13:19:27Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Todo:&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
Done:&lt;br /&gt;
* [[User:Przemoc/Todo/Users and groups for AL 3.4]]&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=13548</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=13548"/>
		<updated>2017-05-30T13:16:51Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I wanted to do and did before AL 3.4 release and some fixing done afterwards.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Pre-install/upgrade scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Improvements ===&lt;br /&gt;
&lt;br /&gt;
==== Make all packages create only &#039;&#039;system&#039;&#039; users and groups ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
=== Corrections ===&lt;br /&gt;
&lt;br /&gt;
==== Fix problems introduced by adding -S to adduser ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches)&lt;br /&gt;
&lt;br /&gt;
Patches for main and community are already cherry-picked in 3.4-stable branch as of 2016-06-20.&lt;br /&gt;
&lt;br /&gt;
Following packages were overlooked before:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;br /&gt;
&lt;br /&gt;
My commit fixing them is:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=94e0b0631f37 94e0b0631f37] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-20)&lt;br /&gt;
&lt;br /&gt;
It is part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3109.html Forgotten pre-install addgroup/adduser fixes and fixes.] (5 patches)&lt;br /&gt;
&lt;br /&gt;
==== Fix problems for those who already installed above mentioned packages in Alpine Linux 3.4.0  ====&lt;br /&gt;
&lt;br /&gt;
Fixes in previous sections work only for people that haven&#039;t installed above mentioned packages within Alpine Linux 3.4.0.&lt;br /&gt;
Even package removal and reinstallation is not enough, because old entries in &amp;lt;code&amp;gt;/etc/passwd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/group&amp;lt;/code&amp;gt; remain.&lt;br /&gt;
You can remove these old entries before reinstallation using &amp;lt;code&amp;gt;deluser&amp;lt;/code&amp;gt;, but before that you have to find all the files owned by that user (&amp;lt;code&amp;gt;find / -user NAME&amp;lt;/code&amp;gt;) to fix ownership after package reinstallation, as group id will change and user id may change.&lt;br /&gt;
&lt;br /&gt;
We cannot and shouldn&#039;t do such invasive changes in automatic way during upgrade.&lt;br /&gt;
&lt;br /&gt;
I wanted to at least add missing groups and add users to them via upgrades in AL 3.4. (Mind that such users&#039;s primary group will not be changed either, i.e. from &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, because user could have changed it on her/his own.) But there wasn&#039;t much interest, even though I provided some patches, like for below examples (so called AL 3.4 band-aids for ccc056dbf9d3 in .pre-* script).&lt;br /&gt;
&lt;br /&gt;
Examples of known problems for people upgrading from Alpine Linux 3.4.0:&lt;br /&gt;
&lt;br /&gt;
* main/apache2: No &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; group. (Default config uses &amp;lt;code&amp;gt;apache:apache&amp;lt;/code&amp;gt;, so daemon won&#039;t start.)&lt;br /&gt;
* main/lighttpd: No &amp;lt;code&amp;gt;lighttpd&amp;lt;/code&amp;gt; group.&lt;br /&gt;
&lt;br /&gt;
I consider this topic in the context of AL 3.4 closed.&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo&amp;diff=13540</id>
		<title>User:Przemoc/Todo</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo&amp;diff=13540"/>
		<updated>2017-05-30T12:49:08Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Przemoc moved page User:Przemoc/Todo to User:Przemoc/Todo/Users and groups for AL 3.4: It became one topic page, so let it truly be.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[User:Przemoc/Todo/Users and groups for AL 3.4]]&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=13539</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=13539"/>
		<updated>2017-05-30T12:49:07Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Przemoc moved page User:Przemoc/Todo to User:Przemoc/Todo/Users and groups for AL 3.4: It became one topic page, so let it truly be.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I want to do for AL.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Users and groups ==&lt;br /&gt;
&lt;br /&gt;
=== Pre-install/upgrade scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Improvements ====&lt;br /&gt;
&lt;br /&gt;
===== Make all packages create only &#039;&#039;system&#039;&#039; users and groups =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
==== Corrections ====&lt;br /&gt;
&lt;br /&gt;
===== Fix problems introduced by adding -S to adduser =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches)&lt;br /&gt;
&lt;br /&gt;
Patches for main and community are already cherry-picked in 3.4-stable branch as of 2016-06-20.&lt;br /&gt;
&lt;br /&gt;
Following packages were overlooked before:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;br /&gt;
&lt;br /&gt;
My commit fixing them is:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=94e0b0631f37 94e0b0631f37] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-20)&lt;br /&gt;
&lt;br /&gt;
It is part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3109.html Forgotten pre-install addgroup/adduser fixes and fixes.] (5 patches)&lt;br /&gt;
&lt;br /&gt;
===== Fix problems for those who already installed above mentioned packages in Alpine Linux 3.4.0  =====&lt;br /&gt;
&lt;br /&gt;
Fixes in previous sections work only for people that haven&#039;t installed above mentioned packages within Alpine Linux 3.4.0.&lt;br /&gt;
Even package removal and reinstallation is not enough, because old entries in &amp;lt;code&amp;gt;/etc/passwd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/group&amp;lt;/code&amp;gt; remain.&lt;br /&gt;
You can remove these old entries before reinstallation using &amp;lt;code&amp;gt;deluser&amp;lt;/code&amp;gt;, but before that you have to find all the files owned by that user (&amp;lt;code&amp;gt;find / -user NAME&amp;lt;/code&amp;gt;) to fix ownership after package reinstallation, as group id will change and user id may change.&lt;br /&gt;
&lt;br /&gt;
We cannot and shouldn&#039;t do such invasive changes in automatic way during upgrade, but we can at least add missing groups and add users to them. Mind that such users&#039;s primary group will not be changed either (from &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;), because user could have changed it on her/his own.&lt;br /&gt;
&lt;br /&gt;
Below I&#039;ll try to document all known problems:&lt;br /&gt;
&lt;br /&gt;
* main/apache2: No &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; group. (Default config uses &amp;lt;code&amp;gt;apache:apache&amp;lt;/code&amp;gt;, so daemon won&#039;t start.)&amp;lt;br&amp;gt;(sent to ML already, but it&#039;s postponed as it will be a part of bigger pull request(s) - it was discussed with ncopa on IRC)&lt;br /&gt;
&lt;br /&gt;
{{todo|Go through all packages, starting from main.}}&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12868</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12868"/>
		<updated>2016-06-20T16:52:24Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I want to do for AL.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Users and groups ==&lt;br /&gt;
&lt;br /&gt;
=== Pre-install/upgrade scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Improvements ====&lt;br /&gt;
&lt;br /&gt;
===== Make all packages create only &#039;&#039;system&#039;&#039; users and groups =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
==== Corrections ====&lt;br /&gt;
&lt;br /&gt;
===== Fix problems introduced by adding -S to adduser =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches)&lt;br /&gt;
&lt;br /&gt;
Patches for main and community are already cherry-picked in 3.4-stable branch as of 2016-06-20.&lt;br /&gt;
&lt;br /&gt;
Following packages were overlooked before:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;br /&gt;
&lt;br /&gt;
My commit fixing them is:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=94e0b0631f37 94e0b0631f37] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-20)&lt;br /&gt;
&lt;br /&gt;
It is part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3109.html Forgotten pre-install addgroup/adduser fixes and fixes.] (5 patches)&lt;br /&gt;
&lt;br /&gt;
===== Fix problems for those who already installed above mentioned packages in Alpine Linux 3.4.0  =====&lt;br /&gt;
&lt;br /&gt;
Fixes in previous sections work only for people that haven&#039;t installed above mentioned packages within Alpine Linux 3.4.0.&lt;br /&gt;
Even package removal and reinstallation is not enough, because old entries in &amp;lt;code&amp;gt;/etc/passwd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/group&amp;lt;/code&amp;gt; remain.&lt;br /&gt;
You can remove these old entries before reinstallation using &amp;lt;code&amp;gt;deluser&amp;lt;/code&amp;gt;, but before that you have to find all the files owned by that user (&amp;lt;code&amp;gt;find / -user NAME&amp;lt;/code&amp;gt;) to fix ownership after package reinstallation, as group id will change and user id may change.&lt;br /&gt;
&lt;br /&gt;
We cannot and shouldn&#039;t do such invasive changes in automatic way during upgrade, but we can at least add missing groups and add users to them. Mind that such users&#039;s primary group will not be changed either (from &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;), because user could have changed it on her/his own.&lt;br /&gt;
&lt;br /&gt;
Below I&#039;ll try to document all known problems:&lt;br /&gt;
&lt;br /&gt;
* main/apache2: No &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; group. (Default config uses &amp;lt;code&amp;gt;apache:apache&amp;lt;/code&amp;gt;, so daemon won&#039;t start.)&amp;lt;br&amp;gt;(sent to ML already, but it&#039;s postponed as it will be a part of bigger pull request(s) - it was discussed with ncopa on IRC)&lt;br /&gt;
&lt;br /&gt;
{{todo|Go through all packages, starting from main.}}&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12867</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12867"/>
		<updated>2016-06-20T16:48:54Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I want to do for AL.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Users and groups ==&lt;br /&gt;
&lt;br /&gt;
=== Pre-install/upgrade scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Improvements ====&lt;br /&gt;
&lt;br /&gt;
===== Make all packages create only &#039;&#039;system&#039;&#039; users and groups =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
==== Corrections ====&lt;br /&gt;
&lt;br /&gt;
===== Fix problems introduced by adding -S to adduser =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches)&lt;br /&gt;
&lt;br /&gt;
Following packages were overlooked before:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;br /&gt;
&lt;br /&gt;
My commit fixing them is:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=94e0b0631f37 94e0b0631f37] testing/[various]: Add group and use it as primary in .pre-* scripts.&lt;br /&gt;
&lt;br /&gt;
It is part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3109.html Forgotten pre-install addgroup/adduser fixes and fixes.] (5 patches)&lt;br /&gt;
&lt;br /&gt;
===== Fix problems for those who already installed above mentioned packages in Alpine Linux 3.4.0  =====&lt;br /&gt;
&lt;br /&gt;
Fixes in previous sections work only for people that haven&#039;t installed above mentioned packages within Alpine Linux 3.4.0.&lt;br /&gt;
Even package removal and reinstallation is not enough, because old entries in &amp;lt;code&amp;gt;/etc/passwd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/group&amp;lt;/code&amp;gt; remain.&lt;br /&gt;
You can remove these old entries before reinstallation using &amp;lt;code&amp;gt;deluser&amp;lt;/code&amp;gt;, but before that you have to find all the files owned by that user (&amp;lt;code&amp;gt;find / -user NAME&amp;lt;/code&amp;gt;) to fix ownership after package reinstallation, as group id will change and user id may change.&lt;br /&gt;
&lt;br /&gt;
We cannot and shouldn&#039;t do such invasive changes in automatic way during upgrade, but we can at least add missing groups and add users to them. Mind that such users&#039;s primary group will not be changed either (from &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;), because user could have changed it on her/his own.&lt;br /&gt;
&lt;br /&gt;
Below I&#039;ll try to document all known problems:&lt;br /&gt;
&lt;br /&gt;
* main/apache2: No &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; group. (Default config uses &amp;lt;code&amp;gt;apache:apache&amp;lt;/code&amp;gt;, so daemon won&#039;t start.)&amp;lt;br&amp;gt;(sent to ML already, but it&#039;s postponed as it will be a part of bigger pull request(s) - it was discussed with ncopa on IRC)&lt;br /&gt;
&lt;br /&gt;
{{todo|Go through all packages, starting from main.}}&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12866</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12866"/>
		<updated>2016-06-20T10:23:30Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Update.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I want to do for AL.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Users and groups ==&lt;br /&gt;
&lt;br /&gt;
=== Pre-install/upgrade scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Improvements ====&lt;br /&gt;
&lt;br /&gt;
===== Make all packages create only &#039;&#039;system&#039;&#039; users and groups =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
==== Corrections ====&lt;br /&gt;
&lt;br /&gt;
===== Fix problems introduced by adding -S to adduser =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches)&lt;br /&gt;
&lt;br /&gt;
Following packages still need patches:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;br /&gt;
&lt;br /&gt;
These patches have been already sent to ML in patch set:&lt;br /&gt;
* Forgotten pre-install addgroup/adduser fixes and fixes. (5 patches)&lt;br /&gt;
&lt;br /&gt;
===== Fix problems for those who already installed above mentioned packages in Alpine Linux 3.4.0  =====&lt;br /&gt;
&lt;br /&gt;
Fixes in previous sections work only for people that haven&#039;t installed above mentioned packages within Alpine Linux 3.4.0.&lt;br /&gt;
Even package removal and reinstallation is not enough, because old entries in &amp;lt;code&amp;gt;/etc/passwd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/group&amp;lt;/code&amp;gt; remain.&lt;br /&gt;
You can remove these old entries before reinstallation using &amp;lt;code&amp;gt;deluser&amp;lt;/code&amp;gt;, but before that you have to find all the files owned by that user (&amp;lt;code&amp;gt;find / -user NAME&amp;lt;/code&amp;gt;) to fix ownership after package reinstallation, as group id will change and user id may change.&lt;br /&gt;
&lt;br /&gt;
We cannot and shouldn&#039;t do such invasive changes in automatic way during upgrade, but we can at least add missing groups and add users to them. Mind that such users&#039;s primary group will not be changed either (from &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;), because user could have changed it on her/his own.&lt;br /&gt;
&lt;br /&gt;
Below I&#039;ll try to document all known problems:&lt;br /&gt;
&lt;br /&gt;
* main/apache2: No &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; group. (Default config uses &amp;lt;code&amp;gt;apache:apache&amp;lt;/code&amp;gt;, so daemon won&#039;t start.)&amp;lt;br&amp;gt;(sent to ML already)&lt;br /&gt;
&lt;br /&gt;
{{todo|Go through all packages, starting from main.}}&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12858</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12858"/>
		<updated>2016-06-17T15:28:06Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Better formatting.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I want to do for AL.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Users and groups ==&lt;br /&gt;
&lt;br /&gt;
=== Pre-install/upgrade scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Improvements ====&lt;br /&gt;
&lt;br /&gt;
===== Make all packages create only &#039;&#039;system&#039;&#039; users and groups =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
==== Corrections ====&lt;br /&gt;
&lt;br /&gt;
===== Fix problems introduced by adding -S to adduser =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches)&lt;br /&gt;
&lt;br /&gt;
Following packages still need patches:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;br /&gt;
&lt;br /&gt;
These patches have been already sent to ML in patch set:&lt;br /&gt;
* Forgotten pre-install addgroup/adduser fixes and fixes. (5 patches)&lt;br /&gt;
&lt;br /&gt;
===== Fix problems for those who already installed above mentioned packages in Alpine Linux 3.4.0  =====&lt;br /&gt;
&lt;br /&gt;
Fixes in previous sections work only for people that haven&#039;t installed above mentioned packages within Alpine Linux 3.4.0.&lt;br /&gt;
Even package removal and reinstallation is not enough, because old entries in &amp;lt;code&amp;gt;/etc/passwd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/group&amp;lt;/code&amp;gt; remain.&lt;br /&gt;
You can remove these old entries before reinstallation using &amp;lt;code&amp;gt;deluser&amp;lt;/code&amp;gt;, but before that you have to find all the files owned by that user (&amp;lt;code&amp;gt;find / -user NAME&amp;lt;/code&amp;gt;) to fix ownership after package reinstallation, as group id will change and user id may change.&lt;br /&gt;
&lt;br /&gt;
We cannot and shouldn&#039;t do such invasive changes in automatic way during upgrade, but we can at least add missing groups and add users to them. Mind that such users&#039;s primary group will not be changed either (from &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;), because user could have changed it on her/his own.&lt;br /&gt;
&lt;br /&gt;
Below I&#039;ll try to document all known problems:&lt;br /&gt;
&lt;br /&gt;
* main/apache2: No &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; group. (Default config uses &amp;lt;code&amp;gt;apache:apache&amp;lt;/code&amp;gt;, so daemon won&#039;t start.)&lt;br /&gt;
&lt;br /&gt;
{{todo|Go through all packages, starting from main.}}&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12857</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12857"/>
		<updated>2016-06-17T15:11:56Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I want to do for AL.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Users and groups ==&lt;br /&gt;
&lt;br /&gt;
=== Pre-install/upgrade scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Improvements ====&lt;br /&gt;
&lt;br /&gt;
===== Make all packages create only &#039;&#039;system&#039;&#039; users and groups =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
==== Corrections ====&lt;br /&gt;
&lt;br /&gt;
===== Fix problems introduced by adding -S to adduser =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches)&lt;br /&gt;
&lt;br /&gt;
Following packages still need patches:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;br /&gt;
&lt;br /&gt;
These patches have been already sent to ML in patch set:&lt;br /&gt;
* Forgotten pre-install addgroup/adduser fixes and fixes. (5 patches)&lt;br /&gt;
&lt;br /&gt;
===== Fix problems for those who already installed above mentioned packages in Alpine Linux 3.4.0  =====&lt;br /&gt;
&lt;br /&gt;
Fixes in previous sections work only for people that haven&#039;t installed above mentioned packages within Alpine Linux 3.4.0.&lt;br /&gt;
Even package removal and reinstallation is not enough, because old entries in &amp;lt;code&amp;gt;/etc/passwd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/group&amp;lt;/code&amp;gt; remain.&lt;br /&gt;
You can remove these old entries before reinstallation using &amp;lt;code&amp;gt;deluser&amp;lt;/code&amp;gt;, but before that you have to find all the files owned by that user (&amp;lt;code&amp;gt;find / -user NAME&amp;lt;/code&amp;gt;) to fix ownership after package reinstallation, as group id will change and user id may change.&lt;br /&gt;
&lt;br /&gt;
We cannot and shouldn&#039;t do such invasive changes in automatic way during upgrade, but we can at least add missing groups and add users to them. Mind that such users&#039;s primary group will not be changed either (from nogroup), because user could have changed it on her/his own.&lt;br /&gt;
&lt;br /&gt;
Below I&#039;ll try to document all known problems &lt;br /&gt;
&lt;br /&gt;
* main/apache2: No &amp;lt;code&amp;gt;apache&amp;lt;/code&amp;gt; group. (Default config uses &amp;lt;code&amp;gt;apache:apache&amp;lt;/code&amp;gt;, so daemon won&#039;t start.)&lt;br /&gt;
&lt;br /&gt;
{{todo|Go through all packages, starting from main.}}&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12856</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12856"/>
		<updated>2016-06-17T01:58:47Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Update regarding needed patches.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I want to do for AL.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Users and groups ==&lt;br /&gt;
&lt;br /&gt;
=== Pre-install/upgrade scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Improvements ====&lt;br /&gt;
&lt;br /&gt;
===== Make all packages create only &#039;&#039;system&#039;&#039; users and groups =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
==== Corrections ====&lt;br /&gt;
&lt;br /&gt;
===== Fix problems introduced by adding -S to adduser =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches)&lt;br /&gt;
&lt;br /&gt;
Following packages still need patches:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;br /&gt;
&lt;br /&gt;
These patches have been already sent to ML in patch set:&lt;br /&gt;
* Forgotten pre-install addgroup/adduser fixes and fixes. (5 patches)&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12845</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12845"/>
		<updated>2016-06-15T10:33:42Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Fix omission&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I want to do for AL.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Users and groups ==&lt;br /&gt;
&lt;br /&gt;
=== Pre-install/upgrade scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Improvements ====&lt;br /&gt;
&lt;br /&gt;
===== Make all packages create only &#039;&#039;system&#039;&#039; users and groups =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
==== Corrections ====&lt;br /&gt;
&lt;br /&gt;
===== Fix problems introduced by adding -S to adduser =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
&lt;br /&gt;
They are (apart from the first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.] (15 patches)&lt;br /&gt;
&lt;br /&gt;
Following packages still need patches:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12844</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12844"/>
		<updated>2016-06-15T10:31:34Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Fix formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I want to do for AL.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Users and groups ==&lt;br /&gt;
&lt;br /&gt;
=== Pre-install/upgrade scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Improvements ====&lt;br /&gt;
&lt;br /&gt;
===== Make all packages create only &#039;&#039;system&#039;&#039; users and groups =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
==== Corrections ====&lt;br /&gt;
&lt;br /&gt;
===== Fix problems introduced by adding -S to adduser =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
 * [http://git.alpinelinux.org/cgit/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts. (2016-06-07)&lt;br /&gt;
&lt;br /&gt;
They are (apart from first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.]&lt;br /&gt;
&lt;br /&gt;
Following packages still need patches:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12842</id>
		<title>User:Przemoc/Todo/Users and groups for AL 3.4</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Todo/Users_and_groups_for_AL_3.4&amp;diff=12842"/>
		<updated>2016-06-15T08:25:05Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Created page with &amp;quot;What I want to do for AL.  __TOC__  == Users and groups ==  === Pre-install/upgrade scripts ===  ==== Improvements ====  ===== Make all packages create only &amp;#039;&amp;#039;system&amp;#039;&amp;#039; users a...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What I want to do for AL.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Users and groups ==&lt;br /&gt;
&lt;br /&gt;
=== Pre-install/upgrade scripts ===&lt;br /&gt;
&lt;br /&gt;
==== Improvements ====&lt;br /&gt;
&lt;br /&gt;
===== Make all packages create only &#039;&#039;system&#039;&#039; users and groups =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
Call &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option in pre-install/upgrade scripts.&lt;br /&gt;
It&#039;s mostly done already and only mostly, because 1) some new packages might have been added that aren&#039;t using &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; yet and 2) it introduced problems, which aren&#039;t fully fixed yet. &lt;br /&gt;
&lt;br /&gt;
{{note|&lt;br /&gt;
System user creation doesn&#039;t add same named group and uses nogroup as primary group unless explicitly specified via &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It means that system user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option present)&lt;br /&gt;
differs from normal user creation (&amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; without &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; option) in more&lt;br /&gt;
ways than the range of used UIDs and the default GECOS field.&lt;br /&gt;
&lt;br /&gt;
Normal user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, gets its own automatically&lt;br /&gt;
created group, and this group becomes primary group of that user.&lt;br /&gt;
Group creation can be avoided if &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used, but then already&lt;br /&gt;
existing group has to be provided there.&lt;br /&gt;
&lt;br /&gt;
System user, when created via &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, never gets its own automatically&lt;br /&gt;
created group and by default primary group of that user becomes group&lt;br /&gt;
called &amp;lt;code&amp;gt;nogroup&amp;lt;/code&amp;gt;, unless &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option is used to provide other already&lt;br /&gt;
existing group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
My commit:&lt;br /&gt;
* [http://git.alpinelinux.org/cgit/aports/commit/?id=ccc056dbf9d3 ccc056dbf9d3] Add lacking -S option (system) to adduser/addgroup in scripts. (2016-04-25)&lt;br /&gt;
&lt;br /&gt;
It was part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/2909.html Pre-upgrade/pre-install addgroup/adduser cleanings] (7 patches)&lt;br /&gt;
&lt;br /&gt;
==== Corrections ====&lt;br /&gt;
&lt;br /&gt;
===== Fix problems introduced by adding -S to adduser =====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;(MOSTLY DONE)&#039;&#039;&#039;&lt;br /&gt;
I somehow overlooked different adduser behavior explained in above note&lt;br /&gt;
and thus my sole adding of &amp;lt;code&amp;gt;-S&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; calls&lt;br /&gt;
in commit ccc056dbf9d3&lt;br /&gt;
(i.e. without proper &amp;lt;code&amp;gt;-G&amp;lt;/code&amp;gt; option and preceding &amp;lt;code&amp;gt;addgroup&amp;lt;/code&amp;gt; call when needed)&lt;br /&gt;
proved to be drastic in effects, i.e. status quo has not been preserved,&lt;br /&gt;
because primary groups of those users in new Alpine Linux installations has been changed.&lt;br /&gt;
Alpine Linux 3.4.0 is affected by this.&lt;br /&gt;
&lt;br /&gt;
Lesson relearned. Beware of such small and allegedly &amp;quot;cosmetic&amp;quot; changes!&lt;br /&gt;
&lt;br /&gt;
Pre-install/upgrade scripts are already mostly fixed in master branch of aports repository.&lt;br /&gt;
&lt;br /&gt;
Packages creating users that were badly touched by commit ccc056dbf9d3 and should have been already fixed:&lt;br /&gt;
* community/caddy&lt;br /&gt;
* community/domoticz&lt;br /&gt;
* community/oscam&lt;br /&gt;
* community/syncthing&lt;br /&gt;
* main/apache2&lt;br /&gt;
* main/aports-build&lt;br /&gt;
* main/atheme-iris&lt;br /&gt;
* main/clamav&lt;br /&gt;
* main/clamsmtp&lt;br /&gt;
* main/coova-chilli&lt;br /&gt;
* main/dhcp&lt;br /&gt;
* main/djbdns&lt;br /&gt;
* main/dovecot&lt;br /&gt;
* main/ez-ipupdate&lt;br /&gt;
* main/fetchmail&lt;br /&gt;
* main/freeswitch&lt;br /&gt;
* main/gitolite&lt;br /&gt;
* main/gnats&lt;br /&gt;
* main/gross&lt;br /&gt;
* main/icecast&lt;br /&gt;
* main/lighttpd&lt;br /&gt;
* main/memcached&lt;br /&gt;
* main/ngircd&lt;br /&gt;
* main/nrpe&lt;br /&gt;
* main/openntpd&lt;br /&gt;
* main/postgrey&lt;br /&gt;
* main/snort&lt;br /&gt;
* main/squid&lt;br /&gt;
* main/transmission&lt;br /&gt;
* main/znc&lt;br /&gt;
* testing/at&lt;br /&gt;
* testing/dbmail&lt;br /&gt;
* testing/dspam&lt;br /&gt;
* testing/opensips&lt;br /&gt;
* testing/pdns&lt;br /&gt;
* testing/qpage&lt;br /&gt;
* testing/rrdbot&lt;br /&gt;
* testing/wt&lt;br /&gt;
&lt;br /&gt;
My commits fixing them are:&lt;br /&gt;
* [http://git.alpinelinux.org/cgit/aports/commit/?id=1de4b02204f7 1de4b02204f7] main/lighttpd: Fix lighttpd user&#039;s primary group. (2016-06-03)&lt;br /&gt;
* [http://git.alpinelinux.org/cgit/aports/commit/?id=f27dface22b3 f27dface22b3] testing/at: Properly set primary group in .pre-install.&lt;br /&gt;
* [http://git.alpinelinux.org/cgit/aports/commit/?id=40521bdafd3c 40521bdafd3c] main/dovecot: Properly set primary group in .pre-install.&lt;br /&gt;
* [http://git.alpinelinux.org/cgit/aports/commit/?id=3c1fa46624bd 3c1fa46624bd] main/{npre, postgrey}: Properly set primary group in .pre-install.&lt;br /&gt;
* [http://git.alpinelinux.org/cgit/aports/commit/?id=a7d67c695ca2 a7d67c695ca2] main/[various]: Add group and use it as primary in .pre-* scripts.&lt;br /&gt;
* [http://git.alpinelinux.org/cgit/aports/commit/?id=5708404c50a7 5708404c50a7] community/[various]: Add group and use it as primary in .pre-* scripts.&lt;br /&gt;
* [http://git.alpinelinux.org/cgit/aports/commit/?id=a835b6916533 a835b6916533] testing/[various]: Add group and use it as primary in .pre-* scripts.&lt;br /&gt;
&lt;br /&gt;
They are (apart from first one) part of patch set:&lt;br /&gt;
* [http://lists.alpinelinux.org/alpine-aports/3059.html Pre-upgrade/pre-install addgroup/adduser fixes.]&lt;br /&gt;
&lt;br /&gt;
Following packages still need patches:&lt;br /&gt;
* testing/buildbot&lt;br /&gt;
* testing/buildbot-slave&lt;br /&gt;
* testing/clapf&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc&amp;diff=12841</id>
		<title>User:Przemoc</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc&amp;diff=12841"/>
		<updated>2016-06-15T07:18:26Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Przemoc/Notes]]&lt;br /&gt;
&lt;br /&gt;
[[User:Przemoc/Todo]]&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc&amp;diff=12840</id>
		<title>User:Przemoc</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc&amp;diff=12840"/>
		<updated>2016-06-15T07:17:28Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Link my todo list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Przemoc/Notes]]&lt;br /&gt;
[[User:Przemoc/Todo]]&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12839</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12839"/>
		<updated>2016-06-14T23:13:38Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Applications/Irssi&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case of normal users it&#039;s: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:lightgreen;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:lightgreen&amp;quot;&amp;gt;]$&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&lt;br /&gt;
If you have physical access to screen connected to your machine with AL, it&#039;s nice to have properly configured console.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 encoding ====&lt;br /&gt;
&lt;br /&gt;
To have UTF-8 from OpenRC point of view, you have to set in &amp;lt;code&amp;gt;/etc/rc.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;unicode=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/termencoding&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add termencoding}}&lt;br /&gt;
In fact it&#039;s mostly irrelevant (prove me wrong).&lt;br /&gt;
&lt;br /&gt;
==== Font with polish letters ====&lt;br /&gt;
&lt;br /&gt;
To be able to see polish letters, you have to install &#039;&#039;kbd-misc&#039;&#039; package, set in &amp;lt;code&amp;gt;/etc/conf.d/consolefont&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;consolefont=&amp;quot;lat2-sun16.psfu.gz&amp;quot;&lt;br /&gt;
consoletranslation=&amp;quot;8859-2_to_uni.trans&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/consolefont&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add consolefont}}&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like default &amp;lt;code&amp;gt;default8x16.psf.gz&amp;lt;/code&amp;gt; font, then use &amp;lt;code&amp;gt;lat2-16.psfu.gz&amp;lt;/code&amp;gt; instead. If you&#039;re comfortable with lower letter height, then I suggest using &amp;lt;code&amp;gt;lat2-14.psfu.gz&amp;lt;/code&amp;gt;, which is still readable, yet on my 1920x1200 display increases LINES number from 75 to 85.&lt;br /&gt;
&lt;br /&gt;
==== Keymap with only right Alt used for inputting polish letters ====&lt;br /&gt;
&lt;br /&gt;
Default polish keymap &amp;lt;code&amp;gt;pl&amp;lt;/code&amp;gt; uses both Alt keys for polish letters. If you prefer left Alt to be usable for other stuff (like switching to active window in irssi via Alt+A), then you have to switch to &amp;lt;code&amp;gt;pl1&amp;lt;/code&amp;gt; variant. &#039;&#039;bkeymaps&#039;&#039; package is needed for setting, but can be removed later.&lt;br /&gt;
{{cmd|setup-keymap pl pl1}}&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 in tmux ====&lt;br /&gt;
&lt;br /&gt;
tmux checks upon start-up whether environment variable &amp;lt;code&amp;gt;LC_ALL&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt;, contain string &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF8&amp;lt;/code&amp;gt; to activate its UTF-8 mode. It can be also triggered by &amp;lt;code&amp;gt;-u&amp;lt;/code&amp;gt; option. Important part is that globally turning on &amp;lt;code&amp;gt;utf8&amp;lt;/code&amp;gt; window option in tmux configuration doesn&#039;t enforce UTF-8 mode.&lt;br /&gt;
&lt;br /&gt;
musl has locale system since v1.1.4, it was incomplete and experimental, but I&#039;m not sure how it is now. The thing is it&#039;s not leveraged by AL and by default you have no &amp;lt;code&amp;gt;LC_*&amp;lt;/code&amp;gt; variables set. In musl built-in default is &amp;lt;code&amp;gt;C.UTF-8&amp;lt;/code&amp;gt;, so we can simply create one file to set &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt; to such default value and it will satisfy tmux check:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/locale.sh|export LC_CTYPE{{=}}C.UTF-8&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Possible alternative is to alias &amp;lt;code&amp;gt;tmux&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;tmux -u&amp;lt;/code&amp;gt;, but it seems clunky.&lt;br /&gt;
&lt;br /&gt;
==== Serial console ====&lt;br /&gt;
&lt;br /&gt;
To get tty on serial port you have to uncomment line in &amp;lt;code&amp;gt;/etc/inittab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you want to be able to log as root using serial console, you have to add the serial port (here: &amp;lt;code&amp;gt;ttyS0&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;/etc/securetty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Finally you can reload &amp;lt;code&amp;gt;init&amp;lt;/code&amp;gt; process configuration:&lt;br /&gt;
{{cmd|kill -HUP 1&lt;br /&gt;
}}&lt;br /&gt;
Now you&#039;ll see login stuff on the serial port.&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;s/\#.*//g;/^[[:space:]]*$/d&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (deleting blank lines).&lt;br /&gt;
{{note|Patch has been sent to alpine-devel ML. http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3432. It was applied in commit [http://git.alpinelinux.org/cgit/aports/commit/?id{{=}}fc95677dd60833bca07ad5c2a037058e94471ff7 fc95677dd608] (2016-04-21)}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
{{note|Problem has been reported to alpine-devel ML: http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3433. File has been removed in commit [http://git.alpinelinux.org/cgit/aports/commit/?id{{=}}05ca027f69eb029ba8ddc97700639dbe5cb3ad91 05ca027f69eb] (2016-04-20).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mail ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t need my own real mail server (as it&#039;s kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.&lt;br /&gt;
&lt;br /&gt;
==== msmtp ====&lt;br /&gt;
&lt;br /&gt;
After installing &#039;&#039;msmtp&#039;&#039; package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.msmtprc|defaults&lt;br /&gt;
tls on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
logfile ~/.msmtp.log&lt;br /&gt;
auth on&lt;br /&gt;
port 587&lt;br /&gt;
&lt;br /&gt;
account yourname@zoho.com&lt;br /&gt;
from yourname@zoho.com&lt;br /&gt;
user yourname@zoho.com&lt;br /&gt;
host smtp.zoho.com&lt;br /&gt;
&lt;br /&gt;
account default : yourname@zoho.com&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be asked for password every time mail is sent.&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
If you use gmail, then it&#039;s no longer that simple. After changing each zoho to gmail in above exemplary configuration, you still won&#039;t be able to send any mail. You&#039;ll get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msmtp: server message: 534-5.7.14 &amp;lt;https://accounts.google.com/signin/continue?sarp=1&amp;amp;scc=1&amp;amp;plt=...&amp;gt; Please log in via your web browser and then try again.&lt;br /&gt;
msmtp: server message: 534-5.7.14  Learn more at&lt;br /&gt;
msmtp: server message: 534-5.7.14  https://support.google.com/mail/answer/78754 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll receive e-mail titled &amp;quot;Sign-in attempt prevented&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You have to [https://www.google.com/settings/security/lesssecureapps turn on less secure apps] if you want to deal with it. If you&#039;re using 2-step verification, then you&#039;ll have to [https://security.google.com/settings/security/apppasswords add app password for msmtp].&lt;br /&gt;
&lt;br /&gt;
=== Applications ===&lt;br /&gt;
&lt;br /&gt;
Some tips for some applications.&lt;br /&gt;
&lt;br /&gt;
==== Irssi ====&lt;br /&gt;
&lt;br /&gt;
Irssi is my IRC client of choice.&lt;br /&gt;
&lt;br /&gt;
===== /script support =====&lt;br /&gt;
&lt;br /&gt;
You have to add following line in &amp;lt;code&amp;gt;~/.irssi/startup&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;/LOAD perl&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=12833</id>
		<title>Creating an Alpine package</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=12833"/>
		<updated>2016-06-06T00:16:59Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: /* install */ Fix $pkgname.pre-install example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
&lt;br /&gt;
To build a package for Alpine Linux you need an Alpine Linux installation. Check the [[Installation]] page to see all available installation options.&lt;br /&gt;
&lt;br /&gt;
== Setup your system and account  ==&lt;br /&gt;
{{:Include:Setup_your_system_and_account_for_building_packages}}&lt;br /&gt;
&lt;br /&gt;
== Getting some help ==&lt;br /&gt;
&lt;br /&gt;
It might be wise to start by checking what the [[Abuild|abuild]] program can/cannot do.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -h}}&lt;br /&gt;
&lt;br /&gt;
== Creating an APKBUILD file  ==&lt;br /&gt;
&lt;br /&gt;
=== Use a template APKBUILD ===&lt;br /&gt;
&lt;br /&gt;
To create the actual APKBUILD file {{Pkg|newapkbuild}} can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file to the given directory, and fill some variables if those are provided. Please check the [[Package_policies| package policies]] page about naming details.&lt;br /&gt;
&lt;br /&gt;
If you doubt to which repository your package belongs to you can safely use &#039;&#039;&#039;testing&#039;&#039;&#039;. Building package in your aports/testing directory is not mandatory but this way the package is already at the right place.&lt;br /&gt;
&lt;br /&gt;
{{:Include:Newapkbuild}}&lt;br /&gt;
&lt;br /&gt;
{{Note|On older Alpine systems, abuild -c -n &#039;&#039;packagename&#039;&#039; was the way to create APKBUILD files. The &#039;packagename&#039; was a parameter to the -n option so order of -c and -n matters. }}&lt;br /&gt;
&lt;br /&gt;
[[Abuild_and_Helpers#apkbuild-cpan|apkbuild-cpan]] simplifies the creation of perl packages from CPAN and [[Abuild_and_Helpers#apkbuild-pypi|apkbuild-pypi]] ease the generation of APKBUILD files for python packages from PyPi.  &lt;br /&gt;
&lt;br /&gt;
If you are create a daemon package which needs initd scripts you can add the -c making it: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|newapkbuild -c &#039;&#039;packagename&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
This will copy the sample initd and confd files to the build directory.&amp;lt;BR&amp;gt;&lt;br /&gt;
A third file sample.install file will be copied as well (we will discuss this later on).&lt;br /&gt;
&lt;br /&gt;
=== Modify your APKBUILD ===&lt;br /&gt;
Edit APKBUILD and fill in the needed info (especially pkgname, pkgver, pkgdesc, url, license, depends and source). &lt;br /&gt;
&lt;br /&gt;
If you are going to use any of the variables for directories like $pkgdir, always make sure they are double quoted like: &lt;br /&gt;
&lt;br /&gt;
 &amp;quot;$pkgdir&amp;quot;/somedir&lt;br /&gt;
&lt;br /&gt;
This will prevent issues with spaces/special characters in the future. &lt;br /&gt;
&lt;br /&gt;
{{Note|If you like syntax highlighting we suggest you to install vim. We have setup vim to recognize the APKBUILD file as a bash scripts so its easier to read them.}}&lt;br /&gt;
&lt;br /&gt;
=== APKBUILD variables/functions  ===&lt;br /&gt;
&lt;br /&gt;
==== source  ====&lt;br /&gt;
&lt;br /&gt;
The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[Creating an Alpine package#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
: {{cmd|abuild checksum}}&lt;br /&gt;
: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
* When the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
: You must prepend &#039;${pkgname}-${pkgver}.tar.gz::&#039; to the protocol, like so:&lt;br /&gt;
: &amp;lt;pre&amp;gt;source=&amp;quot;${pkgname}-${pkgver}.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
: This causes the file to be saved as &#039;&#039;software-1.0.tar.gz&#039;&#039; where abuild can use it, instead of &#039;&#039;?get=software&amp;amp;ver=1.0&#039;&#039;, where abuild cannot use it.&lt;br /&gt;
&lt;br /&gt;
* Some projects didn&#039;t provide a release tarball. If you point source to an tarball provided by a git web interface (gitweg, cgit, github), such as:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://repo.or.cz/w/gitstats.git/snapshot/ad7efbb9399e60cee6cb217c6b47e604174a8093.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: You will run into issues because the checksum changes when downloading on the build system.&lt;br /&gt;
&lt;br /&gt;
* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
** http&lt;br /&gt;
** https&lt;br /&gt;
** ftp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--: {{Note|If the you want to download from https, you need GNU wget installed on your system.}}--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
** .tar.gz / .tgz&lt;br /&gt;
** .tar.bz2&lt;br /&gt;
** .tar.lzma&lt;br /&gt;
** .tar.xz&lt;br /&gt;
** .zip&lt;br /&gt;
&lt;br /&gt;
==== depends &amp;amp;amp; makedepends  ====&lt;br /&gt;
&lt;br /&gt;
Depends are the actual running dependencies that a package would need when it is running. Makedepends are only needed when you are building a package. If you set a package, in depends you do not need to add it to makedepends as well. The best way to find out what the depends and makedepends of a package are is to [http://en.wikipedia.org/wiki/Rtfm RTFM]. &lt;br /&gt;
&lt;br /&gt;
No kidding, lots of important information can be found it the package INSTALL and README file (or the likes). Another good way is the run &amp;lt;code&amp;gt;./configure --help&amp;lt;/code&amp;gt; from the source directory to see which options are needed for configure to finish without errors. If you do not yet have a source directory you can create one with the command: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild unpack}}&lt;br /&gt;
&lt;br /&gt;
Running &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; will also show you how you can disable a specific option for this package. A good example is for instance &amp;quot;--disable-nls&amp;quot; which will disable native language support and thus does not depend on gettext (libiconv, glib, ...). &lt;br /&gt;
&lt;br /&gt;
Alpine likes to keep things small, so we try to disable as much as possible without losing too many features. The exact disable/enable options are decided the package builder but please try to follow Alpine&#039;s design concept as much as possible.&lt;br /&gt;
&lt;br /&gt;
An easy way of quickly finding out the build info for a package is to check Arch Linux (Alpine package management and build scripts are similar) or Gentoo Linux ebuilds (previous versions of Alpine were based on Gentoo).&lt;br /&gt;
&lt;br /&gt;
* [http://www.gentoo-portage.com Search ebuilds] &lt;br /&gt;
* [http://sources.gentoo.org/viewcvs.py/gentoo-x86/ Gentoo CVS] &lt;br /&gt;
* [http://www.archlinux.org/packages/search/ Arch Linux packages] [https://aur.archlinux.org/ Arch Linux User Repository]&lt;br /&gt;
&lt;br /&gt;
After the package is successfully compiled and created we should make sure it didn&#039;t link to any package that is not present in the &amp;lt;code&amp;gt;$depends&amp;lt;/code&amp;gt; variable. We do this by using &amp;lt;code&amp;gt;scanelf&amp;lt;/code&amp;gt;. If scanelf is not yet installed on your system you can do that by installing {{Pkg|pax-utils}}.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|scanelf -nR pkg}}&lt;br /&gt;
&lt;br /&gt;
An example output of {{Pkg|libcurl}} would be: &lt;br /&gt;
&lt;br /&gt;
 ET_DYN libssl.so.0.9.8,libcrypto.so.0.9.8,libz.so.1,libc.so.0,ld-uClibc.so.0 pkg/usr/lib/libcurl.so.4.1.1&lt;br /&gt;
&lt;br /&gt;
You can see the needed files and should be able to find out which file belongs to which package.&lt;br /&gt;
&lt;br /&gt;
==== license  ====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;license&#039;&#039;&#039; tag must reflect the license of the source code. Please check the source tarball for COPYING, LICENSE, or other files with names that indicates that it contains licensing information. Beside the license file most developer include headers in the source code files with licensing details. Please use the short name and the release number in the license tag, e.g &lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;5&amp;quot; border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! Short name&lt;br /&gt;
! Full name&lt;br /&gt;
|-&lt;br /&gt;
| GPL2&lt;br /&gt;
| GNU General Public License Version 2.0&lt;br /&gt;
|-&lt;br /&gt;
| LGPL2+&lt;br /&gt;
| GNU Lesser General Public License Version 2.1&lt;br /&gt;
|-&lt;br /&gt;
| ASL 2.0&lt;br /&gt;
| Apache License Version 2.0&lt;br /&gt;
|-&lt;br /&gt;
| BSD&lt;br /&gt;
| BSD License&lt;br /&gt;
|-&lt;br /&gt;
| MIT&lt;br /&gt;
| MIT license&lt;br /&gt;
|-&lt;br /&gt;
| MPL 2.0&lt;br /&gt;
| Mozilla Public License v2.0&lt;br /&gt;
|-&lt;br /&gt;
| ZPL 2.0 &lt;br /&gt;
| Zope Public License v 2.0&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| PHP License v3.0&lt;br /&gt;
|-&lt;br /&gt;
| zlib&lt;br /&gt;
| zlib/libpng License&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For the GNU General Public License the &#039;+&#039; means &#039;&#039;or (at your option) any later version.&#039;&#039; which covers future releases of that license. We skip the &#039;&#039;v&#039;&#039; because it&#039;s obvious that the number shows the version. If you are unsure about the short name of a license, please check the resources below for additional information.&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/Licenses ArchLinux and Licensing] &lt;br /&gt;
* [https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses Fedora and Licensing]&lt;br /&gt;
&lt;br /&gt;
If a package has a special/custom license we need to provide it with the release. Because we want to save space and don&#039;t like to have licenses all over our system we have decided to include the license in the doc subpackage. Please follow the following guidelines to add a proper license. Locate the license file inside the source package. Add the doc subpackage to the $subpackages variable as follows: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Add a similar line to the following to your package() function, depending on the license description file: &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 COPYING &amp;quot;$pkgdir&amp;quot;/usr/share/licenses/$pkgname/COPYING&lt;br /&gt;
&lt;br /&gt;
If you follow these steps then abuild will automatically add the license to the package-doc apk for you.&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
&lt;br /&gt;
The package architecture(s) to build for.  This can be one of: &#039;&#039;x86, x86_64, all,&#039;&#039; or &#039;&#039;noarch&#039;&#039;, where &#039;&#039;all&#039;&#039; means all architectures, and &#039;&#039;noarch&#039;&#039; means it&#039;s architecture-independent (ie, a pure-python package).&lt;br /&gt;
{{Tip|To determine if your APKBUILD can use &#039;&#039;noarch&#039;&#039;, build the package for your architecture and then run &amp;quot;scanelf -R pkg&amp;quot; from the directory that the APKBUILD resides in, in order to scan for ELF files in the &#039;&#039;./pkg&#039;&#039; directory.  If you do NOT get output from this, then &#039;&#039;noarch&#039;&#039; can be used.}}&lt;br /&gt;
&lt;br /&gt;
==== url  ====&lt;br /&gt;
&lt;br /&gt;
Website address for the program. This is usefully later on when either finding documentation or other information about the package.&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc  ====&lt;br /&gt;
&lt;br /&gt;
A brief, one line, description of what the package does. Useful for the package management system.&lt;br /&gt;
&lt;br /&gt;
Here is an example from apk_info for the OpenSSH client package&lt;br /&gt;
&lt;br /&gt;
 pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== pkgver  ====&lt;br /&gt;
&lt;br /&gt;
Provide the release number of the package you are building.&lt;br /&gt;
&lt;br /&gt;
==== pkgrel  ====&lt;br /&gt;
&lt;br /&gt;
The $pkgrel versioning is made so if you change something to your APKBUILD file without changing the actual $pkgver you can higer pkgrel so apk tools will detect it as an update. For instance if you forget to add a dependency you can add it afterward and you can +1 pkgver so apk finds this update and add the missing dependency. When there&#039;s an upstream version changes, we reset the pkgrel to 0.&lt;br /&gt;
&lt;br /&gt;
==== pkgname  ====&lt;br /&gt;
&lt;br /&gt;
The base name of the package you are creating.  For Freeswitch 1.0.6, you would use &amp;quot;freeswitch&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== install  ====&lt;br /&gt;
&lt;br /&gt;
There are 6 different kinds of install scripts. Each script is called with the $pkgname.&#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; where &#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; is one of the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-install&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed before package is installed. Typical use is when package needs a group and a user to be created. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
addgroup -S clamav 2&amp;gt;/dev/null&lt;br /&gt;
adduser -S -D -H -s /bin/false -G clamav -g clamav clamav 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note the &#039;&#039;exit 0&#039;&#039; at the end. If the script exits with failure (if the user already exist), the package will not be installed and &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt; will exit with failure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-install&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed after package is installed. Can be used to generate font cache and similar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-upgrade&lt;br /&gt;
&amp;lt;dd&amp;gt;Same as pre-install but is executed before upgrading an already installed package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-upgrade&lt;br /&gt;
&amp;lt;dd&amp;gt;Same as post-install but is executed after upgrading an already installed package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-deinstall&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed before uninstalling a package. If script exits with failure apk will not uninstall the package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-deinstall&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed after a package have been uninstalled. Can be used to update font caches and restore busybox links. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
busybox --install -s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the package have an pre-install and post-install script the APKBUILD should have the &#039;&#039;install&#039;&#039; variable defined and the scripts should also be added to the source variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
install=&amp;quot;$pkgname.pre-install $pkgname.post-install&amp;quot;&lt;br /&gt;
source=&amp;quot;http://....&lt;br /&gt;
       $install&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== subpackages  ====&lt;br /&gt;
&lt;br /&gt;
$subpackages are made to split up the normal &amp;quot;make install&amp;quot; into separate packages. The most common subpackages we use are doc and dev. Because we like to keep our target system small we move documentation and development files (only needed when building packages) into separate packages. To use the specific program a user only need to install the base apk without package-doc or package-dev, but if he wants to read the manual he will need to install package-doc. &lt;br /&gt;
&lt;br /&gt;
The easiest way to find out if you need to use -dev and -doc is to first build the package without these options set and wait until the build finishes. When its finished you should have a pkg directory which is the fake root directory. Inside this directory you will see the structure as how it would be installed in / on the target system. &lt;br /&gt;
&lt;br /&gt;
To see if you need the -dev package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/ -name &#039;*.[acho]&#039; -o -name &#039;*.la&#039;}}&lt;br /&gt;
&lt;br /&gt;
If this returns any files you need to include the -dev package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; To see if you need the -doc package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/share -name doc -o -name man -o -name info -o -name html -o -name sgml -o -name licenses}}&lt;br /&gt;
&lt;br /&gt;
If this returns any directories you need to include the -doc package. &lt;br /&gt;
&lt;br /&gt;
===== Custom subpackages  =====&lt;br /&gt;
&lt;br /&gt;
Some software additionally has non-essential files that do not qualify as either documentation or development content. These files should be placed in their own, specialized subpackage(s). Some packages include large test suites which are only needed in specific circumstances or binaries which have depends which we prefer not to install. To handle those we create our own package/function. In the APKBUILD below the build() function we create another function: &lt;br /&gt;
&lt;br /&gt;
 test() {&lt;br /&gt;
        mkdir -p &amp;quot;$subpkgdir&amp;quot;/usr&lt;br /&gt;
        mv &amp;quot;$pkgdir&amp;quot;/usr/package-test &amp;quot;$subpkgdir&amp;quot;/usr/&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
We also need to add the package info to $subpackages variable: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc $pkgname-dev $pkgname-test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After we finish building the package you should see another apk called packagename-test.apk which includes the files which we moved to the $subpkgdir dir. &lt;br /&gt;
&lt;br /&gt;
The above mentioned variables can also be used in our custom function. If we want for instance to build the test() function with perl support we would add: &lt;br /&gt;
&lt;br /&gt;
 depends=&amp;quot;perl&amp;quot;&lt;br /&gt;
 makedepends=&amp;quot;perl-dev&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If we would install the base package it would not install perl, but if we install the package-test package it would.&lt;br /&gt;
&lt;br /&gt;
==== Patches  ====&lt;br /&gt;
&lt;br /&gt;
Please make sure you always submit human readable patches. Way&#039;s to create them are: &lt;br /&gt;
&lt;br /&gt;
directory compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -urp original_directory new_directory &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
file compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -up original.file new.file &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
If you are going to use multiple patches for a single package, the preferred way to handle those is a loop and numbering the patches. &lt;br /&gt;
&lt;br /&gt;
 for i in &amp;quot;$srcdir&amp;quot;/*.patch; do&lt;br /&gt;
        msg &amp;quot;Applying ${i}&amp;quot;&lt;br /&gt;
        patch -p0 -i $i || return 1&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
Because multiple patches can patch the same file, we could create offset for the next patch. To make sure we always patch in a specified way we should number the patches as followed: &lt;br /&gt;
&lt;br /&gt;
 10-patch1.patch 20-patch2.patch 30-patch3.patch&lt;br /&gt;
&lt;br /&gt;
This way we are always sure patch 1 is first and if we want to add additional patches between them we can use 11,12,21,22... &lt;br /&gt;
&lt;br /&gt;
==== Configure options  ====&lt;br /&gt;
&lt;br /&gt;
Alpine has some default configure options we set by default. We use /usr for prefix to make sure everything is installed with /usr in front of it. If you notice that anything is installed in the wrong directory please run {{Cmd|./configure --help}} and see if you can set the correct location. &lt;br /&gt;
&lt;br /&gt;
We are not covering the depend switches here we have discussed this already in the depend section.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Common steps for building package contain &#039;&#039;./configure&#039;&#039;, &#039;&#039;make&#039;&#039; and &#039;&#039;make install&#039;&#039;. Everyone of them should be enclosed by &#039;&#039;&amp;amp;#124;&amp;amp;#124; return 1&#039;&#039; to check exit status. Otherwise even if previous step fails e.g. &#039;&#039;./configure&#039;&#039;, next will be launched e.g. &#039;&#039;make&#039;&#039;. This complicates identifying the point where the build breaks. The same applies to installing additional files.}}&lt;br /&gt;
&lt;br /&gt;
==== Make options  ====&lt;br /&gt;
&lt;br /&gt;
If you notice weird problems when compiling or installing the package with make/make install you could try to disable [http://www.gnu.org/software/make/manual/make.html#Parallel parallel] building/installing. A normal make line would be: &lt;br /&gt;
&lt;br /&gt;
 make || return 1&lt;br /&gt;
&lt;br /&gt;
To disable parallel we use: &lt;br /&gt;
&lt;br /&gt;
 make -j1 || return 1&lt;br /&gt;
&lt;br /&gt;
We can use the same for make install. &lt;br /&gt;
&lt;br /&gt;
Because we do not want to install the package in our build environment but we want to install it in a fake root directory we need to tell &#039;make install&#039; to use another destination directory instead of &#039;/&#039;. We do this by setting a variable when we execute make install as followed: &lt;br /&gt;
&lt;br /&gt;
 make DESTDIR=&amp;quot;$pkgdir&amp;quot; install&lt;br /&gt;
&lt;br /&gt;
Please note that some Makefiles do not support this variable and will always install software in &#039;/&#039;. To make sure you do not mess up your build system NEVER run your build system as root but always use a custom user and sudo when needed. If by accident the Makefile does not support DESTDIR variable it will fail to install in our build system system directories.&lt;br /&gt;
&lt;br /&gt;
==== _builddir ====&lt;br /&gt;
If you used &amp;lt;tt&amp;gt;newapkbuild&amp;lt;/tt&amp;gt; to create your APKBUILD file, you must specify the path to your unpacked sources. Inside the sections during the prepare/build/install process &#039;&#039;_builddir&#039;&#039; is used. Most of the time a combination of &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgname-$pkgver&#039;&#039; will work. When not, check the /src directory or the source tarball for the right string. Especially when you are working with automatically generated tarballs (like from github and gitorious), this needs to be adjusted.&lt;br /&gt;
&lt;br /&gt;
 _builddir=&amp;quot;$srcdir&amp;quot;/$pkgname-$pkgver&lt;br /&gt;
&lt;br /&gt;
==== Additional files  ====&lt;br /&gt;
&lt;br /&gt;
If you want/need to install additional files not mentioned above you can use the following cmd (this is an example of a conf file): &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 doc/$pkgname.conf &amp;quot;$pkgdir&amp;quot;/etc/$pkgname.conf&lt;br /&gt;
&lt;br /&gt;
== Build the package  ==&lt;br /&gt;
&lt;br /&gt;
If you did not already create the checksums as mentioned above you can do so now: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $pkgname&lt;br /&gt;
abuild checksum}}&lt;br /&gt;
&lt;br /&gt;
It&#039;s about time we build our package. Because a build system should never have all the package installed to prevent linking to packages we don&#039;t want it to link we use a abuild recursively with the &#039;&#039;&#039;-r&#039;&#039;&#039; switch. It will install all dependency&#039;s from your repository and builds it, afterwards it will uninstall all those depending packages again. You could also use the &#039;&#039;&#039;-R&#039;&#039;&#039; switch which would build your package including the dependency packages. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -r}}&lt;br /&gt;
&lt;br /&gt;
== Commit your work  ==&lt;br /&gt;
&lt;br /&gt;
After you successfully build your package you can submit your APKBUILD to alpine git repository. &lt;br /&gt;
&lt;br /&gt;
Update your git repo, before adding new files: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git pull}}&lt;br /&gt;
&lt;br /&gt;
This should pull all the changes made by others into you local git repo.&lt;br /&gt;
&lt;br /&gt;
When you think you are ready you can add your files to git: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git add  testing/$pkgdir (include any other files needed for the build; $pkgname.install...)&lt;br /&gt;
git commit}}&lt;br /&gt;
&lt;br /&gt;
In the commit message, add the following (remove the comments in the last four lines):&lt;br /&gt;
&lt;br /&gt;
{{Cmd| # Please enter the commit message for your changes&lt;br /&gt;
 #[snip]&lt;br /&gt;
 #&lt;br /&gt;
 testing/$pkgname: new aport   # this will be the subject line&lt;br /&gt;
                               # a blank line&lt;br /&gt;
 $pkgurl                       # homepage of project&lt;br /&gt;
 $pkgdesc                      # a one line description}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now your changes are only available locally in your repository.&lt;br /&gt;
&lt;br /&gt;
Because you do not have push rights to the Alpine aports repository you need to create diff (patch) of the changes you made and send this patch to the &lt;br /&gt;
[http://lists.alpinelinux.org/alpine-aports/  alpine-aports mailinglist].&lt;br /&gt;
&lt;br /&gt;
To create a diff patch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch HEAD^}}&lt;br /&gt;
&lt;br /&gt;
or if you have sprunge, you can create a link to your patch for convenience&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch HEAD^ --stdout &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; sprunge}}&lt;br /&gt;
&lt;br /&gt;
== Send a patch ==&lt;br /&gt;
&lt;br /&gt;
[[Creating_patches#Only_the_last_commit_with_.27git_send-email.27|git send-email]] will do that for you.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[APKBUILD Reference]]&lt;br /&gt;
* [[APKBUILD examples]]&lt;br /&gt;
* [[Development using git]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=12832</id>
		<title>APKBUILD Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=12832"/>
		<updated>2016-06-06T00:16:52Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: /* $pkgname.pre-install */ Fix $pkgname.pre-install example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;APKBUILDs are the scripts that are created in order to build Alpine packages using the [[abuild]] tool.&lt;br /&gt;
&lt;br /&gt;
This page is intended to serve as a reference for creating APKBUILDs; if this is your first time creating a package for Alpine Linux, please see [[Creating an Alpine package]].&lt;br /&gt;
&lt;br /&gt;
= Legend =&lt;br /&gt;
The following notes will assist you in understanding this document.&lt;br /&gt;
&lt;br /&gt;
In description text:&lt;br /&gt;
* If a variable is not prefixed with a &#039;&#039;$&#039;&#039;, it will be represented by italics (i.e., &#039;&#039;srcdir&#039;&#039; ).&lt;br /&gt;
* Functions will also be represented by italics, but will also end with a pair of parentheses (i.e., &#039;&#039;build()&#039;&#039; ).&lt;br /&gt;
* Shell commands will be represented &amp;lt;code&amp;gt;like this&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variables =&lt;br /&gt;
{{Note|Variables that contain a path (e.g. &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgdir&#039;&#039;) should always be quoted using double quotes (i.e., &#039;&#039;&amp;quot;$srcdir&amp;quot;&#039;&#039;).  This is done to prevent things from breaking, should the user have the APKBUILD in a directory path that contains spaces.}}&lt;br /&gt;
{{Note|All arbitrary variable and function names should be prefixed with an underscore character ( _ ) to avoid name clashes with the internals of abuild (for example, &#039;&#039;_builddir&#039;&#039;).}}&lt;br /&gt;
&lt;br /&gt;
== abuild-defined variables ==&lt;br /&gt;
The following variables are defined by abuild:&lt;br /&gt;
&lt;br /&gt;
==== startdir ====&lt;br /&gt;
: The directory where the APKBUILD script is.&lt;br /&gt;
==== srcdir ====&lt;br /&gt;
: The directory where sources, from the &#039;&#039;source&#039;&#039; variable, are downloaded to and unpacked to.&lt;br /&gt;
==== pkgdir ====&lt;br /&gt;
: This directory should receive the files for the main package.  For example, a normal [http://en.wikipedia.org/wiki/GNU_build_system autotools] package would have &amp;lt;code&amp;gt;make DESTDIR=&amp;quot;$pkgdir&amp;quot; install&amp;lt;/code&amp;gt; in the &#039;&#039;package()&#039;&#039; function.&lt;br /&gt;
==== subpkgdir ====&lt;br /&gt;
: This directory should receive the files for a subpackage. This variable should only be used from subpackage functions.&lt;br /&gt;
&lt;br /&gt;
{{Tip|&#039;&#039;_builddir&#039;&#039; is not defined by abuild; instead this should be defined by hand when it&#039;s needed. You might define it as:&lt;br /&gt;
&lt;br /&gt;
 _builddir{{=}}&amp;quot;$srcdir/$pkgname-$pkgver&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== User-defined variables ==&lt;br /&gt;
The following variables should be defined by the user:&lt;br /&gt;
==== arch ====&lt;br /&gt;
: Package architecture(s) to build for.  Can be one of: &#039;&#039;&#039;x86, x86_64, all&#039;&#039;&#039;, or &#039;&#039;&#039;noarch&#039;&#039;&#039;, where &#039;&#039;&#039;all&#039;&#039;&#039; means all architectures, and &#039;&#039;&#039;noarch&#039;&#039;&#039; means it&#039;s architecture-independent (e.g., a pure-python package).&lt;br /&gt;
: {{Tip|To determine if your APKBUILD can use &#039;&#039;&#039;noarch&#039;&#039;&#039;: First specify &#039;&#039;&#039;all&#039;&#039;&#039; and then build the package by executing &amp;lt;code&amp;gt;abuild -r&amp;lt;/code&amp;gt;.  Watch the output towards the end for warnings saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used.  If the main package and all subpackages, if you have any subpackages, give a warning saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used, then you can use &#039;&#039;&#039;noarch&#039;&#039;&#039;.}}&lt;br /&gt;
==== depends ====&lt;br /&gt;
: Run-time dependency package(s) that are not shared-object dependencies.  Shared objects dependencies are auto-detected and should not be specified here.&lt;br /&gt;
==== depends_dev ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
: {{Note|From ncopa on IRC: To find out if you need to add a package to depends_dev have a look at *requires* in usr/lib/pkgconfig/*.pc. With libtool it gets more complicated, but we should delete the .la files. Also check if there are any  /usr/bin/*-configure #!/bin/bash #!/usr/bin/perl or Python. Sometimes scripts or similar are generated at build time (i.e autoconf automake) then you normally don&#039;t need add those to depends_dev. You can also just add all -dev makedepends to depends_dev but it will slow the build process a little bit (more build dependencies).}}&lt;br /&gt;
&lt;br /&gt;
==== install ====&lt;br /&gt;
: There are 6 different types of install scripts.  Install scripts are named &#039;&#039;&#039;$pkgname.action&#039;&#039;&#039;, where &#039;&#039;&#039;action&#039;&#039;&#039; can be:  &#039;&#039;&#039;pre-install, post-install, pre-upgrade, post-upgrade, pre-deinstall&#039;&#039;&#039;, or &#039;&#039;&#039;post-deinstall&#039;&#039;&#039;.  For example, if &#039;&#039;pkgname&#039;&#039; is set to &#039;&#039;&#039;mypackage&#039;&#039;&#039; and &#039;&#039;install&#039;&#039; is set to &#039;&#039;&#039;$pkgname.post-install&#039;&#039;&#039;, then a script named &#039;&#039;&#039;mypackage.post-install&#039;&#039;&#039; must exist along-side the APKBUILD.&lt;br /&gt;
&lt;br /&gt;
: First, a few notes regarding install scripts:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{Note|When using install scripts, &#039;&#039;$install&#039;&#039; should be included in &#039;&#039;source&#039;&#039; so that checksums can be generated and used for the install scripts specified in &#039;&#039;install&#039;&#039;.  For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
install=&amp;quot;$pkgname.pre-install $pkgname.post-install&amp;quot;&lt;br /&gt;
source=&amp;quot;http://....&lt;br /&gt;
       $install&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
{{Note|Always use &amp;lt;code&amp;gt;/bin/sh&amp;lt;/code&amp;gt; for the command-line interpreter on the [http://en.wikipedia.org/wiki/Shebang_%28Unix%29 shebang line] of your install scripts.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are the different types of install scripts in detail:&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-install =====&lt;br /&gt;
: This script is executed &#039;&#039;before installing&#039;&#039; the package.  Typical use is when the package needs a group and a user to be created. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
addgroup -S clamav 2&amp;gt;/dev/null&lt;br /&gt;
adduser -S -D -H -s /bin/false -G clamav -g clamav clamav 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|If the script exits with a failure (e.g., if the user already exists), the package will not be installed and &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will exit with failure, hence the &amp;lt;code&amp;gt;exit 0&amp;lt;/code&amp;gt; at the end.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-install =====&lt;br /&gt;
: This script is executed &#039;&#039;after installing&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;before upgrading&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;after upgrading&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;before uninstalling&#039;&#039; the package.&lt;br /&gt;
: {{Note|If the script exits with failure, &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will not uninstall the package.}}&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;after uninstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
==== license ====&lt;br /&gt;
: License(s) for the package.&lt;br /&gt;
==== makedepends ====&lt;br /&gt;
: Build-time dependency package(s).&lt;br /&gt;
==== md5sums ====&lt;br /&gt;
: Checksums for the files/URLs listed in &#039;&#039;source&#039;&#039;.  The checksums are normally generated and updated by executing &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; and should be the last item in the APKBUILD.&lt;br /&gt;
==== options ====&lt;br /&gt;
: Build-time options for the package.  Can be: &#039;&#039;&#039;!strip&#039;&#039;&#039; - to avoid stripping symbols from binaries.&lt;br /&gt;
==== pkgdesc ====&lt;br /&gt;
: A brief, one-line description of what the package does.&lt;br /&gt;
&lt;br /&gt;
: Here&#039;s an example from the OpenSSH client package:&lt;br /&gt;
: &amp;lt;pre&amp;gt;pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== pkggroups ====&lt;br /&gt;
: System group(s) to be created during build-time.  System group(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system group(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgname ====&lt;br /&gt;
: The name of the package.  All letters should be lowercase.&lt;br /&gt;
: {{Note|When creating an APKBUILD of a module or library for another package, we use some common package prefixes, such as: &#039;&#039;lua-&#039;&#039;, &#039;&#039;perl-&#039;&#039;, &#039;&#039;php-&#039;&#039;, and &#039;&#039;py-&#039;&#039;.  Search aports for other common prefixes.}}&lt;br /&gt;
&lt;br /&gt;
==== pkgrel ====&lt;br /&gt;
: Alpine package release number.  Starts at 0 (zero).  Always increment &#039;&#039;pkgrel&#039;&#039; when making updates to an aport; reset &#039;&#039;pkgrel&#039;&#039; to 0 (zero) when incrementing &#039;&#039;pkgver&#039;&#039;.&lt;br /&gt;
==== pkgusers ====&lt;br /&gt;
: System user(s) to be created during build-time.  System user(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system user(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgver ====&lt;br /&gt;
: The version of the software being packaged.&lt;br /&gt;
==== provides ====&lt;br /&gt;
: Add documentation.&lt;br /&gt;
==== replaces ====&lt;br /&gt;
: Package(s) that this package replaces.  This package will &amp;quot;take over&amp;quot; files owned by packages listed in the &#039;&#039;replaces&#039;&#039; variable.  This is useful when files move from one package to another, or when a package gets renamed.&lt;br /&gt;
==== replaces_priority ====&lt;br /&gt;
: The priority of the replaces. If multiple packages replace each other, then will the package with highest &#039;&#039;replaces_priority&#039;&#039; win.&lt;br /&gt;
==== source ====&lt;br /&gt;
: The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[APKBUILD Reference#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
: Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
:* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
:: {{Cmd|abuild checksum}}&lt;br /&gt;
:: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
:* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
:* You can set target filename (eg &#039;save as...&#039;) by prefixing the URI with &#039;&#039;filename::&#039;&#039;. This is useful when the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: or when the filename is braindead, like githubs&#039; download tags:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: The above two examples needs a target filename prefix:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=$pkgver&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: and:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
:** http&lt;br /&gt;
:** https&lt;br /&gt;
:** ftp&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
:** .tar.gz / .tgz&lt;br /&gt;
:** .tar.bz2&lt;br /&gt;
:** .tar.lzma&lt;br /&gt;
:** .tar.xz&lt;br /&gt;
:** .zip&lt;br /&gt;
&lt;br /&gt;
:: {{Note|Legacy APKBUILD scripts define &#039;&#039;source&#039;&#039; variable as &amp;quot;saveas-[brain-dead-url]/[target-filename]&amp;quot; format instead of the modern [target-filename]::[brain-dead-url].&amp;lt;br /&amp;gt;&#039;&#039;BAD&#039;&#039;:   source&amp;amp;#61;&amp;quot;saveas-http://releases.ddvtech.com/download.php?pack&amp;amp;#61;libmist_dist&amp;amp;ver&amp;amp;#61;RC/$pkgname-$pkgver.tar.gz&amp;quot;&amp;lt;br /&amp;gt;&#039;&#039;GOOD&#039;&#039;:   source&amp;amp;#61;$pkgname-$pkgver.tar.gz::http://releases.ddvtech.com/download.php?pack&amp;amp;#61;libmist_dist&amp;amp;ver&amp;amp;#61;RC&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
==== subpackages ====&lt;br /&gt;
: Subpackages built from this APKBUILD.  abuild will parse this variable and try to find a subpackage split function.  The split function must &#039;&#039;move&#039;&#039; files that do not belong in the main package, from &#039;&#039;$pkgdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.  Files and directories can also be &#039;&#039;copied&#039;&#039; from &#039;&#039;$startdir&#039;&#039; and &#039;&#039;$srcdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: The split function can be specified in 1 of 3 different methods:&lt;br /&gt;
:# subpkgname:&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# $pkgname-&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# &#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: {{Note|Split function names &#039;&#039;&#039;cannot&#039;&#039;&#039; use hyphens; use the first method above if the subpackage name contains a hyphen (-) character, like this: &#039;&#039;subpkg-name:subpkg_name&#039;&#039;, where &amp;lt;code&amp;gt;subpkg-name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;&#039;&#039; and &amp;lt;code&amp;gt;subpkg_name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;s split function&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
: {{Tip|For more information, see the [[APKBUILD_examples:Subpackages|Subpackages example]].}}&lt;br /&gt;
&lt;br /&gt;
==== triggers ====&lt;br /&gt;
: Apk-tools can &amp;quot;monitor&amp;quot; directories and execute a trigger if any package installed/uninstalled any file in the monitored dir. The triggers are always execute after the apk action (install, uninstall, upgrade).&lt;br /&gt;
&lt;br /&gt;
: The triggers are specified in the format: &#039;&#039;scriptname&#039;&#039;=&#039;&#039;pathlist&#039;&#039; where &#039;&#039;scriptname&#039;&#039; is the (sub)package name + .trigger suffix and pathlist is : separated list of the dirs to monitor.&lt;br /&gt;
&lt;br /&gt;
: The &#039;&#039;&#039;triggers&#039;&#039;&#039; variable must include the triggers for subpackages too if they have any.&lt;br /&gt;
&lt;br /&gt;
: It is possible to use wildcards (*) in the dir list.&lt;br /&gt;
&lt;br /&gt;
==== url ====&lt;br /&gt;
: The homepage for the package.  This is to help users find upstream documentation and other information regarding the package.&lt;br /&gt;
&lt;br /&gt;
==== install_if ====&lt;br /&gt;
:install_if can be used when a package needs to be installed when some packages are already installed or are in the dependency tree. As example we could take open-vm-tools. Currently it contains the userspace tools and separate packages for the kernel modules (grsec and vserver). When we install the userspace tools, apk should automatically install the correct kernel modules and will need to figure out for which kernel. This is where install_if jumps in. For any of the kernel modules package we would use:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;install_if=&amp;quot;linux-${_flavor}=${_kernelver} open-vm-tools&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:This will automatically install the package when the specified packages are installed or are in dependency tree.&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
{{Note|All functions should consider the current working directory as undefined, and should therefore use the [[APKBUILD Reference#abuild-defined_variables|abuild-defined directory variables]] to their advantage.}}&lt;br /&gt;
&lt;br /&gt;
== abuild-defined functions ==&lt;br /&gt;
The following functions are provided by abuild and can be overridden:&lt;br /&gt;
&lt;br /&gt;
==== fetch() ====&lt;br /&gt;
: Downloads remote sources listed in &#039;&#039;source&#039;&#039; to &#039;&#039;SRCDEST&#039;&#039; (&#039;&#039;SRCDEST&#039;&#039; is configured in &#039;&#039;/etc/abuild.conf&#039;&#039;) and creates symlinks in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
==== unpack() ====&lt;br /&gt;
: Unpacks .tgz, .tar.gz, .tar.bz2, .tar.lzma, .tar.xz, and .zip archives in &#039;&#039;$srcdir&#039;&#039; to &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
==== dev() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; package.  Without specifying a custom &#039;&#039;dev()&#039;&#039; function, abuild will call it&#039;s internal &#039;&#039;dev()&#039;&#039; function, which in turn calls &#039;&#039;default_dev()&#039;&#039;, which will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/include&#039;&#039;, &#039;&#039;*.a&#039;&#039;, &#039;&#039;*.la&#039;&#039; and similar files to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
==== doc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; package.  Without specifying a custom &#039;&#039;doc()&#039;&#039; function, abuild will call it&#039;s internal &#039;&#039;doc()&#039;&#039; function, which in turn calls &#039;&#039;default_doc()&#039;&#039;, which will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/share/doc&#039;&#039;, &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/share/man&#039;&#039; and similar to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== User-defined functions ==&lt;br /&gt;
The following functions should be defined by the user: &lt;br /&gt;
&lt;br /&gt;
==== prepare() ====&lt;br /&gt;
: &#039;&#039;&#039;&#039;&#039;Optional&#039;&#039;.&#039;&#039;&#039;  Used for build preparation: patches, etc, should be applied here.  This function is available for your convenience.&lt;br /&gt;
==== build() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the compilation stage.  This function will be called as the current user (unless the &#039;&#039;package()&#039;&#039; function is missing - for compatibility reasons).  If no compilation is needed, this function can contain a single line: &amp;lt;code&amp;gt;return 0&amp;lt;/code&amp;gt;&lt;br /&gt;
==== package() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the packaging stage.  Here, the built application and support files should be installed into &#039;&#039;&#039;$pkgdir&#039;&#039;&#039;.  If this is a metapackage, this function can contain a single line: &amp;lt;code&amp;gt;mkdir -p &amp;quot;$pkgdir&amp;quot; &amp;amp;&amp;amp; return 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Building in fakeroot will reduce performance for parallel builds dramatically.  It is for this reason that we split the build and package process into two separate functions.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
The [[APKBUILD examples]] page will assist you in understanding how to create an APKBUILD.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12738</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12738"/>
		<updated>2016-05-08T22:57:57Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Console/Serial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case of normal users it&#039;s: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:lightgreen;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:lightgreen&amp;quot;&amp;gt;]$&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&lt;br /&gt;
If you have physical access to screen connected to your machine with AL, it&#039;s nice to have properly configured console.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 encoding ====&lt;br /&gt;
&lt;br /&gt;
To have UTF-8 from OpenRC point of view, you have to set in &amp;lt;code&amp;gt;/etc/rc.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;unicode=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/termencoding&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add termencoding}}&lt;br /&gt;
In fact it&#039;s mostly irrelevant (prove me wrong).&lt;br /&gt;
&lt;br /&gt;
==== Font with polish letters ====&lt;br /&gt;
&lt;br /&gt;
To be able to see polish letters, you have to install &#039;&#039;kbd-misc&#039;&#039; package, set in &amp;lt;code&amp;gt;/etc/conf.d/consolefont&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;consolefont=&amp;quot;lat2-sun16.psfu.gz&amp;quot;&lt;br /&gt;
consoletranslation=&amp;quot;8859-2_to_uni.trans&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/consolefont&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add consolefont}}&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like default &amp;lt;code&amp;gt;default8x16.psf.gz&amp;lt;/code&amp;gt; font, then use &amp;lt;code&amp;gt;lat2-16.psfu.gz&amp;lt;/code&amp;gt; instead. If you&#039;re comfortable with lower letter height, then I suggest using &amp;lt;code&amp;gt;lat2-14.psfu.gz&amp;lt;/code&amp;gt;, which is still readable, yet on my 1920x1200 display increases LINES number from 75 to 85.&lt;br /&gt;
&lt;br /&gt;
==== Keymap with only right Alt used for inputting polish letters ====&lt;br /&gt;
&lt;br /&gt;
Default polish keymap &amp;lt;code&amp;gt;pl&amp;lt;/code&amp;gt; uses both Alt keys for polish letters. If you prefer left Alt to be usable for other stuff (like switching to active window in irssi via Alt+A), then you have to switch to &amp;lt;code&amp;gt;pl1&amp;lt;/code&amp;gt; variant. &#039;&#039;bkeymaps&#039;&#039; package is needed for setting, but can be removed later.&lt;br /&gt;
{{cmd|setup-keymap pl pl1}}&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 in tmux ====&lt;br /&gt;
&lt;br /&gt;
tmux checks upon start-up whether environment variable &amp;lt;code&amp;gt;LC_ALL&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt;, contain string &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF8&amp;lt;/code&amp;gt; to activate its UTF-8 mode. It can be also triggered by &amp;lt;code&amp;gt;-u&amp;lt;/code&amp;gt; option. Important part is that globally turning on &amp;lt;code&amp;gt;utf8&amp;lt;/code&amp;gt; window option in tmux configuration doesn&#039;t enforce UTF-8 mode.&lt;br /&gt;
&lt;br /&gt;
musl has locale system since v1.1.4, it was incomplete and experimental, but I&#039;m not sure how it is now. The thing is it&#039;s not leveraged by AL and by default you have no &amp;lt;code&amp;gt;LC_*&amp;lt;/code&amp;gt; variables set. In musl built-in default is &amp;lt;code&amp;gt;C.UTF-8&amp;lt;/code&amp;gt;, so we can simply create one file to set &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt; to such default value and it will satisfy tmux check:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/locale.sh|export LC_CTYPE{{=}}C.UTF-8&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Possible alternative is to alias &amp;lt;code&amp;gt;tmux&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;tmux -u&amp;lt;/code&amp;gt;, but it seems clunky.&lt;br /&gt;
&lt;br /&gt;
==== Serial console ====&lt;br /&gt;
&lt;br /&gt;
To get tty on serial port you have to uncomment line in &amp;lt;code&amp;gt;/etc/inittab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you want to be able to log as root using serial console, you have to add the serial port (here: &amp;lt;code&amp;gt;ttyS0&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;/etc/securetty&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Finally you can reload &amp;lt;code&amp;gt;init&amp;lt;/code&amp;gt; process configuration:&lt;br /&gt;
{{cmd|kill -HUP 1&lt;br /&gt;
}}&lt;br /&gt;
Now you&#039;ll see login stuff on the serial port.&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;s/\#.*//g;/^[[:space:]]*$/d&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (deleting blank lines).&lt;br /&gt;
{{note|Patch has been sent to alpine-devel ML. http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3432. It was applied in commit [http://git.alpinelinux.org/cgit/aports/commit/?id{{=}}fc95677dd60833bca07ad5c2a037058e94471ff7 fc95677dd608] (2016-04-21)}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
{{note|Problem has been reported to alpine-devel ML: http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3433. File has been removed in commit [http://git.alpinelinux.org/cgit/aports/commit/?id{{=}}05ca027f69eb029ba8ddc97700639dbe5cb3ad91 05ca027f69eb] (2016-04-20).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mail ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t need my own real mail server (as it&#039;s kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.&lt;br /&gt;
&lt;br /&gt;
==== msmtp ====&lt;br /&gt;
&lt;br /&gt;
After installing &#039;&#039;msmtp&#039;&#039; package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.msmtprc|defaults&lt;br /&gt;
tls on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
logfile ~/.msmtp.log&lt;br /&gt;
auth on&lt;br /&gt;
port 587&lt;br /&gt;
&lt;br /&gt;
account yourname@zoho.com&lt;br /&gt;
from yourname@zoho.com&lt;br /&gt;
user yourname@zoho.com&lt;br /&gt;
host smtp.zoho.com&lt;br /&gt;
&lt;br /&gt;
account default : yourname@zoho.com&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be asked for password every time mail is sent.&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
If you use gmail, then it&#039;s no longer that simple. After changing each zoho to gmail in above exemplary configuration, you still won&#039;t be able to send any mail. You&#039;ll get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msmtp: server message: 534-5.7.14 &amp;lt;https://accounts.google.com/signin/continue?sarp=1&amp;amp;scc=1&amp;amp;plt=...&amp;gt; Please log in via your web browser and then try again.&lt;br /&gt;
msmtp: server message: 534-5.7.14  Learn more at&lt;br /&gt;
msmtp: server message: 534-5.7.14  https://support.google.com/mail/answer/78754 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll receive e-mail titled &amp;quot;Sign-in attempt prevented&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You have to [https://www.google.com/settings/security/lesssecureapps turn on less secure apps] if you want to deal with it. If you&#039;re using 2-step verification, then you&#039;ll have to [https://security.google.com/settings/security/apppasswords add app password for msmtp].&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=12722</id>
		<title>Creating an Alpine package</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&amp;diff=12722"/>
		<updated>2016-04-28T19:09:56Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: /* install */ Improve $pkgname.pre-install example to follow currently used style and arguments order. (aports commits ccc056dbf9d3, a593d306c92f, a60b9f07dee0, da4e96aacef5)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
&lt;br /&gt;
To build a package for Alpine Linux you need an Alpine Linux installation. Check the [[Installation]] page to see all available installation options.&lt;br /&gt;
&lt;br /&gt;
== Setup your system and account  ==&lt;br /&gt;
{{:Include:Setup_your_system_and_account_for_building_packages}}&lt;br /&gt;
&lt;br /&gt;
== Getting some help ==&lt;br /&gt;
&lt;br /&gt;
It might be wise to start by checking what the [[Abuild|abuild]] program can/cannot do.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -h}}&lt;br /&gt;
&lt;br /&gt;
== Creating an APKBUILD file  ==&lt;br /&gt;
&lt;br /&gt;
=== Use a template APKBUILD ===&lt;br /&gt;
&lt;br /&gt;
To create the actual APKBUILD file {{Pkg|newapkbuild}} can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file to the given directory, and fill some variables if those are provided. Please check the [[Package_policies| package policies]] page about naming details.&lt;br /&gt;
&lt;br /&gt;
If you doubt to which repository your package belongs to you can safely use &#039;&#039;&#039;testing&#039;&#039;&#039;. Building package in your aports/testing directory is not mandatory but this way the package is already at the right place.&lt;br /&gt;
&lt;br /&gt;
{{:Include:Newapkbuild}}&lt;br /&gt;
&lt;br /&gt;
{{Note|On older Alpine systems, abuild -c -n &#039;&#039;packagename&#039;&#039; was the way to create APKBUILD files. The &#039;packagename&#039; was a parameter to the -n option so order of -c and -n matters. }}&lt;br /&gt;
&lt;br /&gt;
[[Abuild_and_Helpers#apkbuild-cpan|apkbuild-cpan]] simplifies the creation of perl packages from CPAN and [[Abuild_and_Helpers#apkbuild-pypi|apkbuild-pypi]] ease the generation of APKBUILD files for python packages from PyPi.  &lt;br /&gt;
&lt;br /&gt;
If you are create a daemon package which needs initd scripts you can add the -c making it: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|newapkbuild -c &#039;&#039;packagename&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
This will copy the sample initd and confd files to the build directory.&amp;lt;BR&amp;gt;&lt;br /&gt;
A third file sample.install file will be copied as well (we will discuss this later on).&lt;br /&gt;
&lt;br /&gt;
=== Modify your APKBUILD ===&lt;br /&gt;
Edit APKBUILD and fill in the needed info (especially pkgname, pkgver, pkgdesc, url, license, depends and source). &lt;br /&gt;
&lt;br /&gt;
If you are going to use any of the variables for directories like $pkgdir, always make sure they are double quoted like: &lt;br /&gt;
&lt;br /&gt;
 &amp;quot;$pkgdir&amp;quot;/somedir&lt;br /&gt;
&lt;br /&gt;
This will prevent issues with spaces/special characters in the future. &lt;br /&gt;
&lt;br /&gt;
{{Note|If you like syntax highlighting we suggest you to install vim. We have setup vim to recognize the APKBUILD file as a bash scripts so its easier to read them.}}&lt;br /&gt;
&lt;br /&gt;
=== APKBUILD variables/functions  ===&lt;br /&gt;
&lt;br /&gt;
==== source  ====&lt;br /&gt;
&lt;br /&gt;
The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[Creating an Alpine package#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
: {{cmd|abuild checksum}}&lt;br /&gt;
: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
* When the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
: You must prepend &#039;${pkgname}-${pkgver}.tar.gz::&#039; to the protocol, like so:&lt;br /&gt;
: &amp;lt;pre&amp;gt;source=&amp;quot;${pkgname}-${pkgver}.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
: This causes the file to be saved as &#039;&#039;software-1.0.tar.gz&#039;&#039; where abuild can use it, instead of &#039;&#039;?get=software&amp;amp;ver=1.0&#039;&#039;, where abuild cannot use it.&lt;br /&gt;
&lt;br /&gt;
* Some projects didn&#039;t provide a release tarball. If you point source to an tarball provided by a git web interface (gitweg, cgit, github), such as:&lt;br /&gt;
: &amp;lt;pre&amp;gt;http://repo.or.cz/w/gitstats.git/snapshot/ad7efbb9399e60cee6cb217c6b47e604174a8093.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
: You will run into issues because the checksum changes when downloading on the build system.&lt;br /&gt;
&lt;br /&gt;
* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
** http&lt;br /&gt;
** https&lt;br /&gt;
** ftp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--: {{Note|If the you want to download from https, you need GNU wget installed on your system.}}--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
** .tar.gz / .tgz&lt;br /&gt;
** .tar.bz2&lt;br /&gt;
** .tar.lzma&lt;br /&gt;
** .tar.xz&lt;br /&gt;
** .zip&lt;br /&gt;
&lt;br /&gt;
==== depends &amp;amp;amp; makedepends  ====&lt;br /&gt;
&lt;br /&gt;
Depends are the actual running dependencies that a package would need when it is running. Makedepends are only needed when you are building a package. If you set a package, in depends you do not need to add it to makedepends as well. The best way to find out what the depends and makedepends of a package are is to [http://en.wikipedia.org/wiki/Rtfm RTFM]. &lt;br /&gt;
&lt;br /&gt;
No kidding, lots of important information can be found it the package INSTALL and README file (or the likes). Another good way is the run &amp;lt;code&amp;gt;./configure --help&amp;lt;/code&amp;gt; from the source directory to see which options are needed for configure to finish without errors. If you do not yet have a source directory you can create one with the command: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild unpack}}&lt;br /&gt;
&lt;br /&gt;
Running &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; will also show you how you can disable a specific option for this package. A good example is for instance &amp;quot;--disable-nls&amp;quot; which will disable native language support and thus does not depend on gettext (libiconv, glib, ...). &lt;br /&gt;
&lt;br /&gt;
Alpine likes to keep things small, so we try to disable as much as possible without losing too many features. The exact disable/enable options are decided the package builder but please try to follow Alpine&#039;s design concept as much as possible.&lt;br /&gt;
&lt;br /&gt;
An easy way of quickly finding out the build info for a package is to check Arch Linux (Alpine package management and build scripts are similar) or Gentoo Linux ebuilds (previous versions of Alpine were based on Gentoo).&lt;br /&gt;
&lt;br /&gt;
* [http://www.gentoo-portage.com Search ebuilds] &lt;br /&gt;
* [http://sources.gentoo.org/viewcvs.py/gentoo-x86/ Gentoo CVS] &lt;br /&gt;
* [http://www.archlinux.org/packages/search/ Arch Linux packages] [https://aur.archlinux.org/ Arch Linux User Repository]&lt;br /&gt;
&lt;br /&gt;
After the package is successfully compiled and created we should make sure it didn&#039;t link to any package that is not present in the &amp;lt;code&amp;gt;$depends&amp;lt;/code&amp;gt; variable. We do this by using &amp;lt;code&amp;gt;scanelf&amp;lt;/code&amp;gt;. If scanelf is not yet installed on your system you can do that by installing {{Pkg|pax-utils}}.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|scanelf -nR pkg}}&lt;br /&gt;
&lt;br /&gt;
An example output of {{Pkg|libcurl}} would be: &lt;br /&gt;
&lt;br /&gt;
 ET_DYN libssl.so.0.9.8,libcrypto.so.0.9.8,libz.so.1,libc.so.0,ld-uClibc.so.0 pkg/usr/lib/libcurl.so.4.1.1&lt;br /&gt;
&lt;br /&gt;
You can see the needed files and should be able to find out which file belongs to which package.&lt;br /&gt;
&lt;br /&gt;
==== license  ====&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;license&#039;&#039;&#039; tag must reflect the license of the source code. Please check the source tarball for COPYING, LICENSE, or other files with names that indicates that it contains licensing information. Beside the license file most developer include headers in the source code files with licensing details. Please use the short name and the release number in the license tag, e.g &lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;5&amp;quot; border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! Short name&lt;br /&gt;
! Full name&lt;br /&gt;
|-&lt;br /&gt;
| GPL2&lt;br /&gt;
| GNU General Public License Version 2.0&lt;br /&gt;
|-&lt;br /&gt;
| LGPL2+&lt;br /&gt;
| GNU Lesser General Public License Version 2.1&lt;br /&gt;
|-&lt;br /&gt;
| ASL 2.0&lt;br /&gt;
| Apache License Version 2.0&lt;br /&gt;
|-&lt;br /&gt;
| BSD&lt;br /&gt;
| BSD License&lt;br /&gt;
|-&lt;br /&gt;
| MIT&lt;br /&gt;
| MIT license&lt;br /&gt;
|-&lt;br /&gt;
| MPL 2.0&lt;br /&gt;
| Mozilla Public License v2.0&lt;br /&gt;
|-&lt;br /&gt;
| ZPL 2.0 &lt;br /&gt;
| Zope Public License v 2.0&lt;br /&gt;
|-&lt;br /&gt;
| PHP&lt;br /&gt;
| PHP License v3.0&lt;br /&gt;
|-&lt;br /&gt;
| zlib&lt;br /&gt;
| zlib/libpng License&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For the GNU General Public License the &#039;+&#039; means &#039;&#039;or (at your option) any later version.&#039;&#039; which covers future releases of that license. We skip the &#039;&#039;v&#039;&#039; because it&#039;s obvious that the number shows the version. If you are unsure about the short name of a license, please check the resources below for additional information.&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/Licenses ArchLinux and Licensing] &lt;br /&gt;
* [https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses Fedora and Licensing]&lt;br /&gt;
&lt;br /&gt;
If a package has a special/custom license we need to provide it with the release. Because we want to save space and don&#039;t like to have licenses all over our system we have decided to include the license in the doc subpackage. Please follow the following guidelines to add a proper license. Locate the license file inside the source package. Add the doc subpackage to the $subpackages variable as follows: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Add a similar line to the following to your package() function, depending on the license description file: &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 COPYING &amp;quot;$pkgdir&amp;quot;/usr/share/licenses/$pkgname/COPYING&lt;br /&gt;
&lt;br /&gt;
If you follow these steps then abuild will automatically add the license to the package-doc apk for you.&lt;br /&gt;
&lt;br /&gt;
==== arch ====&lt;br /&gt;
&lt;br /&gt;
The package architecture(s) to build for.  This can be one of: &#039;&#039;x86, x86_64, all,&#039;&#039; or &#039;&#039;noarch&#039;&#039;, where &#039;&#039;all&#039;&#039; means all architectures, and &#039;&#039;noarch&#039;&#039; means it&#039;s architecture-independent (ie, a pure-python package).&lt;br /&gt;
{{Tip|To determine if your APKBUILD can use &#039;&#039;noarch&#039;&#039;, build the package for your architecture and then run &amp;quot;scanelf -R pkg&amp;quot; from the directory that the APKBUILD resides in, in order to scan for ELF files in the &#039;&#039;./pkg&#039;&#039; directory.  If you do NOT get output from this, then &#039;&#039;noarch&#039;&#039; can be used.}}&lt;br /&gt;
&lt;br /&gt;
==== url  ====&lt;br /&gt;
&lt;br /&gt;
Website address for the program. This is usefully later on when either finding documentation or other information about the package.&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc  ====&lt;br /&gt;
&lt;br /&gt;
A brief, one line, description of what the package does. Useful for the package management system.&lt;br /&gt;
&lt;br /&gt;
Here is an example from apk_info for the OpenSSH client package&lt;br /&gt;
&lt;br /&gt;
 pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== pkgver  ====&lt;br /&gt;
&lt;br /&gt;
Provide the release number of the package you are building.&lt;br /&gt;
&lt;br /&gt;
==== pkgrel  ====&lt;br /&gt;
&lt;br /&gt;
The $pkgrel versioning is made so if you change something to your APKBUILD file without changing the actual $pkgver you can higer pkgrel so apk tools will detect it as an update. For instance if you forget to add a dependency you can add it afterward and you can +1 pkgver so apk finds this update and add the missing dependency. When there&#039;s an upstream version changes, we reset the pkgrel to 0.&lt;br /&gt;
&lt;br /&gt;
==== pkgname  ====&lt;br /&gt;
&lt;br /&gt;
The base name of the package you are creating.  For Freeswitch 1.0.6, you would use &amp;quot;freeswitch&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== install  ====&lt;br /&gt;
&lt;br /&gt;
There are 6 different kinds of install scripts. Each script is called with the $pkgname.&#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; where &#039;&#039;&amp;lt;action&amp;gt;&#039;&#039; is one of the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-install&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed before package is installed. Typical use is when package needs a user/group to be created. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
adduser -S -D -H -s /bin/false -g clamav clamav 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note the &#039;&#039;exit 0&#039;&#039; at the end. If the script exits with failure (if the user already exist), the package will not be installed and &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt; will exit with failure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-install&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed after package is installed. Can be used to generate font cache and similar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-upgrade&lt;br /&gt;
&amp;lt;dd&amp;gt;Same as pre-install but is executed before upgrading an already installed package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-upgrade&lt;br /&gt;
&amp;lt;dd&amp;gt;Same as post-install but is executed after upgrading an already installed package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.pre-deinstall&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed before uninstalling a package. If script exits with failure apk will not uninstall the package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;$pkgname.post-deinstall&lt;br /&gt;
&amp;lt;dd&amp;gt;This script is executed after a package have been uninstalled. Can be used to update font caches and restore busybox links. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
busybox --install -s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the package have an pre-install and post-install script the APKBUILD should have the &#039;&#039;install&#039;&#039; variable defined and the scripts should also be added to the source variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
install=&amp;quot;$pkgname.pre-install $pkgname.post-install&amp;quot;&lt;br /&gt;
source=&amp;quot;http://....&lt;br /&gt;
       $install&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== subpackages  ====&lt;br /&gt;
&lt;br /&gt;
$subpackages are made to split up the normal &amp;quot;make install&amp;quot; into separate packages. The most common subpackages we use are doc and dev. Because we like to keep our target system small we move documentation and development files (only needed when building packages) into separate packages. To use the specific program a user only need to install the base apk without package-doc or package-dev, but if he wants to read the manual he will need to install package-doc. &lt;br /&gt;
&lt;br /&gt;
The easiest way to find out if you need to use -dev and -doc is to first build the package without these options set and wait until the build finishes. When its finished you should have a pkg directory which is the fake root directory. Inside this directory you will see the structure as how it would be installed in / on the target system. &lt;br /&gt;
&lt;br /&gt;
To see if you need the -dev package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/ -name &#039;*.[acho]&#039; -o -name &#039;*.la&#039;}}&lt;br /&gt;
&lt;br /&gt;
If this returns any files you need to include the -dev package. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; To see if you need the -doc package you can run the following cmd: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|find pkg/usr/share -name doc -o -name man -o -name info -o -name html -o -name sgml -o -name licenses}}&lt;br /&gt;
&lt;br /&gt;
If this returns any directories you need to include the -doc package. &lt;br /&gt;
&lt;br /&gt;
===== Custom subpackages  =====&lt;br /&gt;
&lt;br /&gt;
Some software additionally has non-essential files that do not qualify as either documentation or development content. These files should be placed in their own, specialized subpackage(s). Some packages include large test suites which are only needed in specific circumstances or binaries which have depends which we prefer not to install. To handle those we create our own package/function. In the APKBUILD below the build() function we create another function: &lt;br /&gt;
&lt;br /&gt;
 test() {&lt;br /&gt;
        mkdir -p &amp;quot;$subpkgdir&amp;quot;/usr&lt;br /&gt;
        mv &amp;quot;$pkgdir&amp;quot;/usr/package-test &amp;quot;$subpkgdir&amp;quot;/usr/&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
We also need to add the package info to $subpackages variable: &lt;br /&gt;
&lt;br /&gt;
 subpackages=&amp;quot;$pkgname-doc $pkgname-dev $pkgname-test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
After we finish building the package you should see another apk called packagename-test.apk which includes the files which we moved to the $subpkgdir dir. &lt;br /&gt;
&lt;br /&gt;
The above mentioned variables can also be used in our custom function. If we want for instance to build the test() function with perl support we would add: &lt;br /&gt;
&lt;br /&gt;
 depends=&amp;quot;perl&amp;quot;&lt;br /&gt;
 makedepends=&amp;quot;perl-dev&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If we would install the base package it would not install perl, but if we install the package-test package it would.&lt;br /&gt;
&lt;br /&gt;
==== Patches  ====&lt;br /&gt;
&lt;br /&gt;
Please make sure you always submit human readable patches. Way&#039;s to create them are: &lt;br /&gt;
&lt;br /&gt;
directory compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -urp original_directory new_directory &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
file compare: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|diff -up original.file new.file &amp;amp;gt; filename.patch}}&lt;br /&gt;
&lt;br /&gt;
If you are going to use multiple patches for a single package, the preferred way to handle those is a loop and numbering the patches. &lt;br /&gt;
&lt;br /&gt;
 for i in &amp;quot;$srcdir&amp;quot;/*.patch; do&lt;br /&gt;
        msg &amp;quot;Applying ${i}&amp;quot;&lt;br /&gt;
        patch -p0 -i $i || return 1&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
Because multiple patches can patch the same file, we could create offset for the next patch. To make sure we always patch in a specified way we should number the patches as followed: &lt;br /&gt;
&lt;br /&gt;
 10-patch1.patch 20-patch2.patch 30-patch3.patch&lt;br /&gt;
&lt;br /&gt;
This way we are always sure patch 1 is first and if we want to add additional patches between them we can use 11,12,21,22... &lt;br /&gt;
&lt;br /&gt;
==== Configure options  ====&lt;br /&gt;
&lt;br /&gt;
Alpine has some default configure options we set by default. We use /usr for prefix to make sure everything is installed with /usr in front of it. If you notice that anything is installed in the wrong directory please run {{Cmd|./configure --help}} and see if you can set the correct location. &lt;br /&gt;
&lt;br /&gt;
We are not covering the depend switches here we have discussed this already in the depend section.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Common steps for building package contain &#039;&#039;./configure&#039;&#039;, &#039;&#039;make&#039;&#039; and &#039;&#039;make install&#039;&#039;. Everyone of them should be enclosed by &#039;&#039;&amp;amp;#124;&amp;amp;#124; return 1&#039;&#039; to check exit status. Otherwise even if previous step fails e.g. &#039;&#039;./configure&#039;&#039;, next will be launched e.g. &#039;&#039;make&#039;&#039;. This complicates identifying the point where the build breaks. The same applies to installing additional files.}}&lt;br /&gt;
&lt;br /&gt;
==== Make options  ====&lt;br /&gt;
&lt;br /&gt;
If you notice weird problems when compiling or installing the package with make/make install you could try to disable [http://www.gnu.org/software/make/manual/make.html#Parallel parallel] building/installing. A normal make line would be: &lt;br /&gt;
&lt;br /&gt;
 make || return 1&lt;br /&gt;
&lt;br /&gt;
To disable parallel we use: &lt;br /&gt;
&lt;br /&gt;
 make -j1 || return 1&lt;br /&gt;
&lt;br /&gt;
We can use the same for make install. &lt;br /&gt;
&lt;br /&gt;
Because we do not want to install the package in our build environment but we want to install it in a fake root directory we need to tell &#039;make install&#039; to use another destination directory instead of &#039;/&#039;. We do this by setting a variable when we execute make install as followed: &lt;br /&gt;
&lt;br /&gt;
 make DESTDIR=&amp;quot;$pkgdir&amp;quot; install&lt;br /&gt;
&lt;br /&gt;
Please note that some Makefiles do not support this variable and will always install software in &#039;/&#039;. To make sure you do not mess up your build system NEVER run your build system as root but always use a custom user and sudo when needed. If by accident the Makefile does not support DESTDIR variable it will fail to install in our build system system directories.&lt;br /&gt;
&lt;br /&gt;
==== _builddir ====&lt;br /&gt;
If you used &amp;lt;tt&amp;gt;newapkbuild&amp;lt;/tt&amp;gt; to create your APKBUILD file, you must specify the path to your unpacked sources. Inside the sections during the prepare/build/install process &#039;&#039;_builddir&#039;&#039; is used. Most of the time a combination of &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgname-$pkgver&#039;&#039; will work. When not, check the /src directory or the source tarball for the right string. Especially when you are working with automatically generated tarballs (like from github and gitorious), this needs to be adjusted.&lt;br /&gt;
&lt;br /&gt;
 _builddir=&amp;quot;$srcdir&amp;quot;/$pkgname-$pkgver&lt;br /&gt;
&lt;br /&gt;
==== Additional files  ====&lt;br /&gt;
&lt;br /&gt;
If you want/need to install additional files not mentioned above you can use the following cmd (this is an example of a conf file): &lt;br /&gt;
&lt;br /&gt;
 install -Dm644 doc/$pkgname.conf &amp;quot;$pkgdir&amp;quot;/etc/$pkgname.conf&lt;br /&gt;
&lt;br /&gt;
== Build the package  ==&lt;br /&gt;
&lt;br /&gt;
If you did not already create the checksums as mentioned above you can do so now: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $pkgname&lt;br /&gt;
abuild checksum}}&lt;br /&gt;
&lt;br /&gt;
It&#039;s about time we build our package. Because a build system should never have all the package installed to prevent linking to packages we don&#039;t want it to link we use a abuild recursively with the &#039;&#039;&#039;-r&#039;&#039;&#039; switch. It will install all dependency&#039;s from your repository and builds it, afterwards it will uninstall all those depending packages again. You could also use the &#039;&#039;&#039;-R&#039;&#039;&#039; switch which would build your package including the dependency packages. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -r}}&lt;br /&gt;
&lt;br /&gt;
== Commit your work  ==&lt;br /&gt;
&lt;br /&gt;
After you successfully build your package you can submit your APKBUILD to alpine git repository. &lt;br /&gt;
&lt;br /&gt;
Update your git repo, before adding new files: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git pull}}&lt;br /&gt;
&lt;br /&gt;
This should pull all the changes made by others into you local git repo.&lt;br /&gt;
&lt;br /&gt;
When you think you are ready you can add your files to git: &lt;br /&gt;
&lt;br /&gt;
{{Cmd|cd $aportsdir&lt;br /&gt;
git add  testing/$pkgdir (include any other files needed for the build; $pkgname.install...)&lt;br /&gt;
git commit}}&lt;br /&gt;
&lt;br /&gt;
In the commit message, add the following (remove the comments in the last four lines):&lt;br /&gt;
&lt;br /&gt;
{{Cmd| # Please enter the commit message for your changes&lt;br /&gt;
 #[snip]&lt;br /&gt;
 #&lt;br /&gt;
 testing/$pkgname: new aport   # this will be the subject line&lt;br /&gt;
                               # a blank line&lt;br /&gt;
 $pkgurl                       # homepage of project&lt;br /&gt;
 $pkgdesc                      # a one line description}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now your changes are only available locally in your repository.&lt;br /&gt;
&lt;br /&gt;
Because you do not have push rights to the Alpine aports repository you need to create diff (patch) of the changes you made and send this patch to the &lt;br /&gt;
[http://lists.alpinelinux.org/alpine-devel/ alpine-devel mailinglist].&lt;br /&gt;
&lt;br /&gt;
To create a diff patch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch HEAD^}}&lt;br /&gt;
&lt;br /&gt;
or if you have sprunge, you can create a link to your patch for convenience&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git format-patch HEAD^ --stdout &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; sprunge}}&lt;br /&gt;
&lt;br /&gt;
== Send a patch ==&lt;br /&gt;
&lt;br /&gt;
[[Creating_patches#Only_the_last_commit_with_.27git_send-email.27|git send-email]] will do that for you.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[APKBUILD Reference]]&lt;br /&gt;
* [[APKBUILD examples]]&lt;br /&gt;
* [[Development using git]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=12721</id>
		<title>APKBUILD Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=12721"/>
		<updated>2016-04-28T19:09:16Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: /* $pkgname.pre-install */ Improve $pkgname.pre-install example to follow currently used style and arguments order. (aports commits ccc056dbf9d3, a593d306c92f, a60b9f07dee0, da4e96aacef5)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;APKBUILDs are the scripts that are created in order to build Alpine packages using the [[abuild]] tool.&lt;br /&gt;
&lt;br /&gt;
This page is intended to serve as a reference for creating APKBUILDs; if this is your first time creating a package for Alpine Linux, please see [[Creating an Alpine package]].&lt;br /&gt;
&lt;br /&gt;
= Legend =&lt;br /&gt;
The following notes will assist you in understanding this document.&lt;br /&gt;
&lt;br /&gt;
In description text:&lt;br /&gt;
* If a variable is not prefixed with a &#039;&#039;$&#039;&#039;, it will be represented by italics (i.e., &#039;&#039;srcdir&#039;&#039; ).&lt;br /&gt;
* Functions will also be represented by italics, but will also end with a pair of parentheses (i.e., &#039;&#039;build()&#039;&#039; ).&lt;br /&gt;
* Shell commands will be represented &amp;lt;code&amp;gt;like this&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variables =&lt;br /&gt;
{{Note|Variables that contain a path (e.g. &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgdir&#039;&#039;) should always be quoted using double quotes (i.e., &#039;&#039;&amp;quot;$srcdir&amp;quot;&#039;&#039;).  This is done to prevent things from breaking, should the user have the APKBUILD in a directory path that contains spaces.}}&lt;br /&gt;
{{Note|All arbitrary variable and function names should be prefixed with an underscore character ( _ ) to avoid name clashes with the internals of abuild (for example, &#039;&#039;_builddir&#039;&#039;).}}&lt;br /&gt;
&lt;br /&gt;
== abuild-defined variables ==&lt;br /&gt;
The following variables are defined by abuild:&lt;br /&gt;
&lt;br /&gt;
==== startdir ====&lt;br /&gt;
: The directory where the APKBUILD script is.&lt;br /&gt;
==== srcdir ====&lt;br /&gt;
: The directory where sources, from the &#039;&#039;source&#039;&#039; variable, are downloaded to and unpacked to.&lt;br /&gt;
==== pkgdir ====&lt;br /&gt;
: This directory should receive the files for the main package.  For example, a normal [http://en.wikipedia.org/wiki/GNU_build_system autotools] package would have &amp;lt;code&amp;gt;make DESTDIR=&amp;quot;$pkgdir&amp;quot; install&amp;lt;/code&amp;gt; in the &#039;&#039;package()&#039;&#039; function.&lt;br /&gt;
==== subpkgdir ====&lt;br /&gt;
: This directory should receive the files for a subpackage. This variable should only be used from subpackage functions.&lt;br /&gt;
&lt;br /&gt;
{{Tip|&#039;&#039;_builddir&#039;&#039; is not defined by abuild; instead this should be defined by hand when it&#039;s needed. You might define it as:&lt;br /&gt;
&lt;br /&gt;
 _builddir{{=}}&amp;quot;$srcdir/$pkgname-$pkgver&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== User-defined variables ==&lt;br /&gt;
The following variables should be defined by the user:&lt;br /&gt;
==== arch ====&lt;br /&gt;
: Package architecture(s) to build for.  Can be one of: &#039;&#039;&#039;x86, x86_64, all&#039;&#039;&#039;, or &#039;&#039;&#039;noarch&#039;&#039;&#039;, where &#039;&#039;&#039;all&#039;&#039;&#039; means all architectures, and &#039;&#039;&#039;noarch&#039;&#039;&#039; means it&#039;s architecture-independent (e.g., a pure-python package).&lt;br /&gt;
: {{Tip|To determine if your APKBUILD can use &#039;&#039;&#039;noarch&#039;&#039;&#039;: First specify &#039;&#039;&#039;all&#039;&#039;&#039; and then build the package by executing &amp;lt;code&amp;gt;abuild -r&amp;lt;/code&amp;gt;.  Watch the output towards the end for warnings saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used.  If the main package and all subpackages, if you have any subpackages, give a warning saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used, then you can use &#039;&#039;&#039;noarch&#039;&#039;&#039;.}}&lt;br /&gt;
==== depends ====&lt;br /&gt;
: Run-time dependency package(s) that are not shared-object dependencies.  Shared objects dependencies are auto-detected and should not be specified here.&lt;br /&gt;
==== depends_dev ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
: {{Note|From ncopa on IRC: To find out if you need to add a package to depends_dev have a look at *requires* in usr/lib/pkgconfig/*.pc. With libtool it gets more complicated, but we should delete the .la files. Also check if there are any  /usr/bin/*-configure #!/bin/bash #!/usr/bin/perl or Python. Sometimes scripts or similar are generated at build time (i.e autoconf automake) then you normally don&#039;t need add those to depends_dev. You can also just add all -dev makedepends to depends_dev but it will slow the build process a little bit (more build dependencies).}}&lt;br /&gt;
&lt;br /&gt;
==== install ====&lt;br /&gt;
: There are 6 different types of install scripts.  Install scripts are named &#039;&#039;&#039;$pkgname.action&#039;&#039;&#039;, where &#039;&#039;&#039;action&#039;&#039;&#039; can be:  &#039;&#039;&#039;pre-install, post-install, pre-upgrade, post-upgrade, pre-deinstall&#039;&#039;&#039;, or &#039;&#039;&#039;post-deinstall&#039;&#039;&#039;.  For example, if &#039;&#039;pkgname&#039;&#039; is set to &#039;&#039;&#039;mypackage&#039;&#039;&#039; and &#039;&#039;install&#039;&#039; is set to &#039;&#039;&#039;$pkgname.post-install&#039;&#039;&#039;, then a script named &#039;&#039;&#039;mypackage.post-install&#039;&#039;&#039; must exist along-side the APKBUILD.&lt;br /&gt;
&lt;br /&gt;
: First, a few notes regarding install scripts:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{Note|When using install scripts, &#039;&#039;$install&#039;&#039; should be included in &#039;&#039;source&#039;&#039; so that checksums can be generated and used for the install scripts specified in &#039;&#039;install&#039;&#039;.  For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
install=&amp;quot;$pkgname.pre-install $pkgname.post-install&amp;quot;&lt;br /&gt;
source=&amp;quot;http://....&lt;br /&gt;
       $install&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
{{Note|Always use &amp;lt;code&amp;gt;/bin/sh&amp;lt;/code&amp;gt; for the command-line interpreter on the [http://en.wikipedia.org/wiki/Shebang_%28Unix%29 shebang line] of your install scripts.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are the different types of install scripts in detail:&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-install =====&lt;br /&gt;
: This script is executed &#039;&#039;before installing&#039;&#039; the package.  Typical use is when the package needs a user/group to be created. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
adduser -S -D -H -s /bin/false -g clamav clamav 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|If the script exits with a failure (e.g., if the user already exists), the package will not be installed and &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will exit with failure, hence the &amp;lt;code&amp;gt;exit 0&amp;lt;/code&amp;gt; at the end.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-install =====&lt;br /&gt;
: This script is executed &#039;&#039;after installing&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;before upgrading&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;after upgrading&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;before uninstalling&#039;&#039; the package.&lt;br /&gt;
: {{Note|If the script exits with failure, &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will not uninstall the package.}}&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;after uninstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
==== license ====&lt;br /&gt;
: License(s) for the package.&lt;br /&gt;
==== makedepends ====&lt;br /&gt;
: Build-time dependency package(s).&lt;br /&gt;
==== md5sums ====&lt;br /&gt;
: Checksums for the files/URLs listed in &#039;&#039;source&#039;&#039;.  The checksums are normally generated and updated by executing &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; and should be the last item in the APKBUILD.&lt;br /&gt;
==== options ====&lt;br /&gt;
: Build-time options for the package.  Can be: &#039;&#039;&#039;!strip&#039;&#039;&#039; - to avoid stripping symbols from binaries.&lt;br /&gt;
==== pkgdesc ====&lt;br /&gt;
: A brief, one-line description of what the package does.&lt;br /&gt;
&lt;br /&gt;
: Here&#039;s an example from the OpenSSH client package:&lt;br /&gt;
: &amp;lt;pre&amp;gt;pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== pkggroups ====&lt;br /&gt;
: System group(s) to be created during build-time.  System group(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system group(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgname ====&lt;br /&gt;
: The name of the package.  All letters should be lowercase.&lt;br /&gt;
: {{Note|When creating an APKBUILD of a module or library for another package, we use some common package prefixes, such as: &#039;&#039;lua-&#039;&#039;, &#039;&#039;perl-&#039;&#039;, &#039;&#039;php-&#039;&#039;, and &#039;&#039;py-&#039;&#039;.  Search aports for other common prefixes.}}&lt;br /&gt;
&lt;br /&gt;
==== pkgrel ====&lt;br /&gt;
: Alpine package release number.  Starts at 0 (zero).  Always increment &#039;&#039;pkgrel&#039;&#039; when making updates to an aport; reset &#039;&#039;pkgrel&#039;&#039; to 0 (zero) when incrementing &#039;&#039;pkgver&#039;&#039;.&lt;br /&gt;
==== pkgusers ====&lt;br /&gt;
: System user(s) to be created during build-time.  System user(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system user(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgver ====&lt;br /&gt;
: The version of the software being packaged.&lt;br /&gt;
==== provides ====&lt;br /&gt;
: Add documentation.&lt;br /&gt;
==== replaces ====&lt;br /&gt;
: Package(s) that this package replaces.  This package will &amp;quot;take over&amp;quot; files owned by packages listed in the &#039;&#039;replaces&#039;&#039; variable.  This is useful when files move from one package to another, or when a package gets renamed.&lt;br /&gt;
==== replaces_priority ====&lt;br /&gt;
: The priority of the replaces. If multiple packages replace each other, then will the package with highest &#039;&#039;replaces_priority&#039;&#039; win.&lt;br /&gt;
==== source ====&lt;br /&gt;
: The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[APKBUILD Reference#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
: Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
:* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
:: {{Cmd|abuild checksum}}&lt;br /&gt;
:: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
:* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
:* You can set target filename (eg &#039;save as...&#039;) by prefixing the URI with &#039;&#039;filename::&#039;&#039;. This is useful when the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: or when the filename is braindead, like githubs&#039; download tags:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: The above two examples needs a target filename prefix:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=$pkgver&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: and:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
:** http&lt;br /&gt;
:** https&lt;br /&gt;
:** ftp&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
:** .tar.gz / .tgz&lt;br /&gt;
:** .tar.bz2&lt;br /&gt;
:** .tar.lzma&lt;br /&gt;
:** .tar.xz&lt;br /&gt;
:** .zip&lt;br /&gt;
&lt;br /&gt;
:: {{Note|Legacy APKBUILD scripts define &#039;&#039;source&#039;&#039; variable as &amp;quot;saveas-[brain-dead-url]/[target-filename]&amp;quot; format instead of the modern [target-filename]::[brain-dead-url].&amp;lt;br /&amp;gt;&#039;&#039;BAD&#039;&#039;:   source&amp;amp;#61;&amp;quot;saveas-http://releases.ddvtech.com/download.php?pack&amp;amp;#61;libmist_dist&amp;amp;ver&amp;amp;#61;RC/$pkgname-$pkgver.tar.gz&amp;quot;&amp;lt;br /&amp;gt;&#039;&#039;GOOD&#039;&#039;:   source&amp;amp;#61;$pkgname-$pkgver.tar.gz::http://releases.ddvtech.com/download.php?pack&amp;amp;#61;libmist_dist&amp;amp;ver&amp;amp;#61;RC&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
==== subpackages ====&lt;br /&gt;
: Subpackages built from this APKBUILD.  abuild will parse this variable and try to find a subpackage split function.  The split function must &#039;&#039;move&#039;&#039; files that do not belong in the main package, from &#039;&#039;$pkgdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.  Files and directories can also be &#039;&#039;copied&#039;&#039; from &#039;&#039;$startdir&#039;&#039; and &#039;&#039;$srcdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: The split function can be specified in 1 of 3 different methods:&lt;br /&gt;
:# subpkgname:&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# $pkgname-&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# &#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: {{Note|Split function names &#039;&#039;&#039;cannot&#039;&#039;&#039; use hyphens; use the first method above if the subpackage name contains a hyphen (-) character, like this: &#039;&#039;subpkg-name:subpkg_name&#039;&#039;, where &amp;lt;code&amp;gt;subpkg-name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;&#039;&#039; and &amp;lt;code&amp;gt;subpkg_name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;s split function&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
: {{Tip|For more information, see the [[APKBUILD_examples:Subpackages|Subpackages example]].}}&lt;br /&gt;
&lt;br /&gt;
==== triggers ====&lt;br /&gt;
: Apk-tools can &amp;quot;monitor&amp;quot; directories and execute a trigger if any package installed/uninstalled any file in the monitored dir. The triggers are always execute after the apk action (install, uninstall, upgrade).&lt;br /&gt;
&lt;br /&gt;
: The triggers are specified in the format: &#039;&#039;scriptname&#039;&#039;=&#039;&#039;pathlist&#039;&#039; where &#039;&#039;scriptname&#039;&#039; is the (sub)package name + .trigger suffix and pathlist is : separated list of the dirs to monitor.&lt;br /&gt;
&lt;br /&gt;
: The &#039;&#039;&#039;triggers&#039;&#039;&#039; variable must include the triggers for subpackages too if they have any.&lt;br /&gt;
&lt;br /&gt;
: It is possible to use wildcards (*) in the dir list.&lt;br /&gt;
&lt;br /&gt;
==== url ====&lt;br /&gt;
: The homepage for the package.  This is to help users find upstream documentation and other information regarding the package.&lt;br /&gt;
&lt;br /&gt;
==== install_if ====&lt;br /&gt;
:install_if can be used when a package needs to be installed when some packages are already installed or are in the dependency tree. As example we could take open-vm-tools. Currently it contains the userspace tools and separate packages for the kernel modules (grsec and vserver). When we install the userspace tools, apk should automatically install the correct kernel modules and will need to figure out for which kernel. This is where install_if jumps in. For any of the kernel modules package we would use:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;pre&amp;gt;install_if=&amp;quot;linux-${_flavor}=${_kernelver} open-vm-tools&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:This will automatically install the package when the specified packages are installed or are in dependency tree.&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
{{Note|All functions should consider the current working directory as undefined, and should therefore use the [[APKBUILD Reference#abuild-defined_variables|abuild-defined directory variables]] to their advantage.}}&lt;br /&gt;
&lt;br /&gt;
== abuild-defined functions ==&lt;br /&gt;
The following functions are provided by abuild and can be overridden:&lt;br /&gt;
&lt;br /&gt;
==== fetch() ====&lt;br /&gt;
: Downloads remote sources listed in &#039;&#039;source&#039;&#039; to &#039;&#039;SRCDEST&#039;&#039; (&#039;&#039;SRCDEST&#039;&#039; is configured in &#039;&#039;/etc/abuild.conf&#039;&#039;) and creates symlinks in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
==== unpack() ====&lt;br /&gt;
: Unpacks .tgz, .tar.gz, .tar.bz2, .tar.lzma, .tar.xz, and .zip archives in &#039;&#039;$srcdir&#039;&#039; to &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
==== dev() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; package.  Without specifying a custom &#039;&#039;dev()&#039;&#039; function, abuild will call it&#039;s internal &#039;&#039;dev()&#039;&#039; function, which in turn calls &#039;&#039;default_dev()&#039;&#039;, which will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/include&#039;&#039;, &#039;&#039;*.a&#039;&#039;, &#039;&#039;*.la&#039;&#039; and similar files to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
==== doc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; package.  Without specifying a custom &#039;&#039;doc()&#039;&#039; function, abuild will call it&#039;s internal &#039;&#039;doc()&#039;&#039; function, which in turn calls &#039;&#039;default_doc()&#039;&#039;, which will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/share/doc&#039;&#039;, &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/share/man&#039;&#039; and similar to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== User-defined functions ==&lt;br /&gt;
The following functions should be defined by the user: &lt;br /&gt;
&lt;br /&gt;
==== prepare() ====&lt;br /&gt;
: &#039;&#039;&#039;&#039;&#039;Optional&#039;&#039;.&#039;&#039;&#039;  Used for build preparation: patches, etc, should be applied here.  This function is available for your convenience.&lt;br /&gt;
==== build() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the compilation stage.  This function will be called as the current user (unless the &#039;&#039;package()&#039;&#039; function is missing - for compatibility reasons).  If no compilation is needed, this function can contain a single line: &amp;lt;code&amp;gt;return 0&amp;lt;/code&amp;gt;&lt;br /&gt;
==== package() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the packaging stage.  Here, the built application and support files should be installed into &#039;&#039;&#039;$pkgdir&#039;&#039;&#039;.  If this is a metapackage, this function can contain a single line: &amp;lt;code&amp;gt;mkdir -p &amp;quot;$pkgdir&amp;quot; &amp;amp;&amp;amp; return 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Building in fakeroot will reduce performance for parallel builds dramatically.  It is for this reason that we split the build and package process into two separate functions.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
The [[APKBUILD examples]] page will assist you in understanding how to create an APKBUILD.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12716</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12716"/>
		<updated>2016-04-25T19:17:42Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Shell/Color prompt - update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case of normal users it&#039;s: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:lightgreen;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:lightgreen&amp;quot;&amp;gt;]$&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&lt;br /&gt;
If you have physical access to screen connected to your machine with AL, it&#039;s nice to have properly configured console.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 encoding ====&lt;br /&gt;
&lt;br /&gt;
To have UTF-8 from OpenRC point of view, you have to set in &amp;lt;code&amp;gt;/etc/rc.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;unicode=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/termencoding&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add termencoding}}&lt;br /&gt;
In fact it&#039;s mostly irrelevant (prove me wrong).&lt;br /&gt;
&lt;br /&gt;
==== Font with polish letters ====&lt;br /&gt;
&lt;br /&gt;
To be able to see polish letters, you have to install &#039;&#039;kbd-misc&#039;&#039; package, set in &amp;lt;code&amp;gt;/etc/conf.d/consolefont&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;consolefont=&amp;quot;lat2-sun16.psfu.gz&amp;quot;&lt;br /&gt;
consoletranslation=&amp;quot;8859-2_to_uni.trans&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/consolefont&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add consolefont}}&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like default &amp;lt;code&amp;gt;default8x16.psf.gz&amp;lt;/code&amp;gt; font, then use &amp;lt;code&amp;gt;lat2-16.psfu.gz&amp;lt;/code&amp;gt; instead. If you&#039;re comfortable with lower letter height, then I suggest using &amp;lt;code&amp;gt;lat2-14.psfu.gz&amp;lt;/code&amp;gt;, which is still readable, yet on my 1920x1200 display increases LINES number from 75 to 85.&lt;br /&gt;
&lt;br /&gt;
==== Keymap with only right Alt used for inputting polish letters ====&lt;br /&gt;
&lt;br /&gt;
Default polish keymap &amp;lt;code&amp;gt;pl&amp;lt;/code&amp;gt; uses both Alt keys for polish letters. If you prefer left Alt to be usable for other stuff (like switching to active window in irssi via Alt+A), then you have to switch to &amp;lt;code&amp;gt;pl1&amp;lt;/code&amp;gt; variant. &#039;&#039;bkeymaps&#039;&#039; package is needed for setting, but can be removed later.&lt;br /&gt;
{{cmd|setup-keymap pl pl1}}&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 in tmux ====&lt;br /&gt;
&lt;br /&gt;
tmux checks upon start-up whether environment variable &amp;lt;code&amp;gt;LC_ALL&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt;, contain string &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF8&amp;lt;/code&amp;gt; to activate its UTF-8 mode. It can be also triggered by &amp;lt;code&amp;gt;-u&amp;lt;/code&amp;gt; option. Important part is that globally turning on &amp;lt;code&amp;gt;utf8&amp;lt;/code&amp;gt; window option in tmux configuration doesn&#039;t enforce UTF-8 mode.&lt;br /&gt;
&lt;br /&gt;
musl has locale system since v1.1.4, it was incomplete and experimental, but I&#039;m not sure how it is now. The thing is it&#039;s not leveraged by AL and by default you have no &amp;lt;code&amp;gt;LC_*&amp;lt;/code&amp;gt; variables set. In musl built-in default is &amp;lt;code&amp;gt;C.UTF-8&amp;lt;/code&amp;gt;, so we can simply create one file to set &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt; to such default value and it will satisfy tmux check:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/locale.sh|export LC_CTYPE{{=}}C.UTF-8&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Possible alternative is to alias &amp;lt;code&amp;gt;tmux&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;tmux -u&amp;lt;/code&amp;gt;, but it seems clunky.&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;s/\#.*//g;/^[[:space:]]*$/d&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (deleting blank lines).&lt;br /&gt;
{{note|Patch has been sent to alpine-devel ML. http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3432. It was applied in commit [http://git.alpinelinux.org/cgit/aports/commit/?id{{=}}fc95677dd60833bca07ad5c2a037058e94471ff7 fc95677dd608] (2016-04-21)}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
{{note|Problem has been reported to alpine-devel ML: http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3433. File has been removed in commit [http://git.alpinelinux.org/cgit/aports/commit/?id{{=}}05ca027f69eb029ba8ddc97700639dbe5cb3ad91 05ca027f69eb] (2016-04-20).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mail ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t need my own real mail server (as it&#039;s kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.&lt;br /&gt;
&lt;br /&gt;
==== msmtp ====&lt;br /&gt;
&lt;br /&gt;
After installing &#039;&#039;msmtp&#039;&#039; package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.msmtprc|defaults&lt;br /&gt;
tls on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
logfile ~/.msmtp.log&lt;br /&gt;
auth on&lt;br /&gt;
port 587&lt;br /&gt;
&lt;br /&gt;
account yourname@zoho.com&lt;br /&gt;
from yourname@zoho.com&lt;br /&gt;
user yourname@zoho.com&lt;br /&gt;
host smtp.zoho.com&lt;br /&gt;
&lt;br /&gt;
account default : yourname@zoho.com&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be asked for password every time mail is sent.&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
If you use gmail, then it&#039;s no longer that simple. After changing each zoho to gmail in above exemplary configuration, you still won&#039;t be able to send any mail. You&#039;ll get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msmtp: server message: 534-5.7.14 &amp;lt;https://accounts.google.com/signin/continue?sarp=1&amp;amp;scc=1&amp;amp;plt=...&amp;gt; Please log in via your web browser and then try again.&lt;br /&gt;
msmtp: server message: 534-5.7.14  Learn more at&lt;br /&gt;
msmtp: server message: 534-5.7.14  https://support.google.com/mail/answer/78754 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll receive e-mail titled &amp;quot;Sign-in attempt prevented&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You have to [https://www.google.com/settings/security/lesssecureapps turn on less secure apps] if you want to deal with it. If you&#039;re using 2-step verification, then you&#039;ll have to [https://security.google.com/settings/security/apppasswords add app password for msmtp].&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12715</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12715"/>
		<updated>2016-04-24T00:55:13Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Console/Keymap&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&lt;br /&gt;
If you have physical access to screen connected to your machine with AL, it&#039;s nice to have properly configured console.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 encoding ====&lt;br /&gt;
&lt;br /&gt;
To have UTF-8 from OpenRC point of view, you have to set in &amp;lt;code&amp;gt;/etc/rc.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;unicode=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/termencoding&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add termencoding}}&lt;br /&gt;
In fact it&#039;s mostly irrelevant (prove me wrong).&lt;br /&gt;
&lt;br /&gt;
==== Font with polish letters ====&lt;br /&gt;
&lt;br /&gt;
To be able to see polish letters, you have to install &#039;&#039;kbd-misc&#039;&#039; package, set in &amp;lt;code&amp;gt;/etc/conf.d/consolefont&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;consolefont=&amp;quot;lat2-sun16.psfu.gz&amp;quot;&lt;br /&gt;
consoletranslation=&amp;quot;8859-2_to_uni.trans&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/consolefont&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add consolefont}}&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like default &amp;lt;code&amp;gt;default8x16.psf.gz&amp;lt;/code&amp;gt; font, then use &amp;lt;code&amp;gt;lat2-16.psfu.gz&amp;lt;/code&amp;gt; instead. If you&#039;re comfortable with lower letter height, then I suggest using &amp;lt;code&amp;gt;lat2-14.psfu.gz&amp;lt;/code&amp;gt;, which is still readable, yet on my 1920x1200 display increases LINES number from 75 to 85.&lt;br /&gt;
&lt;br /&gt;
==== Keymap with only right Alt used for inputting polish letters ====&lt;br /&gt;
&lt;br /&gt;
Default polish keymap &amp;lt;code&amp;gt;pl&amp;lt;/code&amp;gt; uses both Alt keys for polish letters. If you prefer left Alt to be usable for other stuff (like switching to active window in irssi via Alt+A), then you have to switch to &amp;lt;code&amp;gt;pl1&amp;lt;/code&amp;gt; variant. &#039;&#039;bkeymaps&#039;&#039; package is needed for setting, but can be removed later.&lt;br /&gt;
{{cmd|setup-keymap pl pl1}}&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 in tmux ====&lt;br /&gt;
&lt;br /&gt;
tmux checks upon start-up whether environment variable &amp;lt;code&amp;gt;LC_ALL&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt;, contain string &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF8&amp;lt;/code&amp;gt; to activate its UTF-8 mode. It can be also triggered by &amp;lt;code&amp;gt;-u&amp;lt;/code&amp;gt; option. Important part is that globally turning on &amp;lt;code&amp;gt;utf8&amp;lt;/code&amp;gt; window option in tmux configuration doesn&#039;t enforce UTF-8 mode.&lt;br /&gt;
&lt;br /&gt;
musl has locale system since v1.1.4, it was incomplete and experimental, but I&#039;m not sure how it is now. The thing is it&#039;s not leveraged by AL and by default you have no &amp;lt;code&amp;gt;LC_*&amp;lt;/code&amp;gt; variables set. In musl built-in default is &amp;lt;code&amp;gt;C.UTF-8&amp;lt;/code&amp;gt;, so we can simply create one file to set &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt; to such default value and it will satisfy tmux check:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/locale.sh|export LC_CTYPE{{=}}C.UTF-8&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Possible alternative is to alias &amp;lt;code&amp;gt;tmux&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;tmux -u&amp;lt;/code&amp;gt;, but it seems clunky.&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;s/\#.*//g;/^[[:space:]]*$/d&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (deleting blank lines).&lt;br /&gt;
{{note|Patch has been sent to alpine-devel ML. http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3432. It was applied in commit [http://git.alpinelinux.org/cgit/aports/commit/?id{{=}}fc95677dd60833bca07ad5c2a037058e94471ff7 fc95677dd608] (2016-04-21)}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
{{note|Problem has been reported to alpine-devel ML: http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3433. File has been removed in commit [http://git.alpinelinux.org/cgit/aports/commit/?id{{=}}05ca027f69eb029ba8ddc97700639dbe5cb3ad91 05ca027f69eb] (2016-04-20).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mail ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t need my own real mail server (as it&#039;s kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.&lt;br /&gt;
&lt;br /&gt;
==== msmtp ====&lt;br /&gt;
&lt;br /&gt;
After installing &#039;&#039;msmtp&#039;&#039; package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.msmtprc|defaults&lt;br /&gt;
tls on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
logfile ~/.msmtp.log&lt;br /&gt;
auth on&lt;br /&gt;
port 587&lt;br /&gt;
&lt;br /&gt;
account yourname@zoho.com&lt;br /&gt;
from yourname@zoho.com&lt;br /&gt;
user yourname@zoho.com&lt;br /&gt;
host smtp.zoho.com&lt;br /&gt;
&lt;br /&gt;
account default : yourname@zoho.com&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be asked for password every time mail is sent.&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
If you use gmail, then it&#039;s no longer that simple. After changing each zoho to gmail in above exemplary configuration, you still won&#039;t be able to send any mail. You&#039;ll get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msmtp: server message: 534-5.7.14 &amp;lt;https://accounts.google.com/signin/continue?sarp=1&amp;amp;scc=1&amp;amp;plt=...&amp;gt; Please log in via your web browser and then try again.&lt;br /&gt;
msmtp: server message: 534-5.7.14  Learn more at&lt;br /&gt;
msmtp: server message: 534-5.7.14  https://support.google.com/mail/answer/78754 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll receive e-mail titled &amp;quot;Sign-in attempt prevented&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You have to [https://www.google.com/settings/security/lesssecureapps turn on less secure apps] if you want to deal with it. If you&#039;re using 2-step verification, then you&#039;ll have to [https://security.google.com/settings/security/apppasswords add app password for msmtp].&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12714</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12714"/>
		<updated>2016-04-23T12:12:01Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Sensors/lm_sensors/Problems - update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&lt;br /&gt;
If you have physical access to screen connected to your machine with AL, it&#039;s nice to have properly configured console.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 encoding ====&lt;br /&gt;
&lt;br /&gt;
To have UTF-8 from OpenRC point of view, you have to set in &amp;lt;code&amp;gt;/etc/rc.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;unicode=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/termencoding&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add termencoding}}&lt;br /&gt;
In fact it&#039;s mostly irrelevant (prove me wrong).&lt;br /&gt;
&lt;br /&gt;
==== Font with polish letters ====&lt;br /&gt;
&lt;br /&gt;
To be able to see polish letters, you have to install &#039;&#039;kbd-misc&#039;&#039; package, set in &amp;lt;code&amp;gt;/etc/conf.d/consolefont&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;consolefont=&amp;quot;lat2-sun16.psfu.gz&amp;quot;&lt;br /&gt;
consoletranslation=&amp;quot;8859-2_to_uni.trans&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/consolefont&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add consolefont}}&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like default &amp;lt;code&amp;gt;default8x16.psf.gz&amp;lt;/code&amp;gt; font, then use &amp;lt;code&amp;gt;lat2-16.psfu.gz&amp;lt;/code&amp;gt; instead. If you&#039;re comfortable with lower letter height, then I suggest using &amp;lt;code&amp;gt;lat2-14.psfu.gz&amp;lt;/code&amp;gt;, which is still readable, yet on my 1920x1200 display increases LINES number from 75 to 85.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 in tmux ====&lt;br /&gt;
&lt;br /&gt;
tmux checks upon start-up whether environment variable &amp;lt;code&amp;gt;LC_ALL&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt;, contain string &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF8&amp;lt;/code&amp;gt; to activate its UTF-8 mode. It can be also triggered by &amp;lt;code&amp;gt;-u&amp;lt;/code&amp;gt; option. Important part is that globally turning on &amp;lt;code&amp;gt;utf8&amp;lt;/code&amp;gt; window option in tmux configuration doesn&#039;t enforce UTF-8 mode.&lt;br /&gt;
&lt;br /&gt;
musl has locale system since v1.1.4, it was incomplete and experimental, but I&#039;m not sure how it is now. The thing is it&#039;s not leveraged by AL and by default you have no &amp;lt;code&amp;gt;LC_*&amp;lt;/code&amp;gt; variables set. In musl built-in default is &amp;lt;code&amp;gt;C.UTF-8&amp;lt;/code&amp;gt;, so we can simply create one file to set &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt; to such default value and it will satisfy tmux check:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/locale.sh|export LC_CTYPE{{=}}C.UTF-8&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Possible alternative is to alias &amp;lt;code&amp;gt;tmux&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;tmux -u&amp;lt;/code&amp;gt;, but it seems clunky.&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;s/\#.*//g;/^[[:space:]]*$/d&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (deleting blank lines).&lt;br /&gt;
{{note|Patch has been sent to alpine-devel ML. http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3432. It was applied in commit [http://git.alpinelinux.org/cgit/aports/commit/?id{{=}}fc95677dd60833bca07ad5c2a037058e94471ff7 fc95677dd608] (2016-04-21)}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
{{note|Problem has been reported to alpine-devel ML: http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3433. File has been removed in commit [http://git.alpinelinux.org/cgit/aports/commit/?id{{=}}05ca027f69eb029ba8ddc97700639dbe5cb3ad91 05ca027f69eb] (2016-04-20).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mail ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t need my own real mail server (as it&#039;s kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.&lt;br /&gt;
&lt;br /&gt;
==== msmtp ====&lt;br /&gt;
&lt;br /&gt;
After installing &#039;&#039;msmtp&#039;&#039; package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.msmtprc|defaults&lt;br /&gt;
tls on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
logfile ~/.msmtp.log&lt;br /&gt;
auth on&lt;br /&gt;
port 587&lt;br /&gt;
&lt;br /&gt;
account yourname@zoho.com&lt;br /&gt;
from yourname@zoho.com&lt;br /&gt;
user yourname@zoho.com&lt;br /&gt;
host smtp.zoho.com&lt;br /&gt;
&lt;br /&gt;
account default : yourname@zoho.com&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be asked for password every time mail is sent.&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
If you use gmail, then it&#039;s no longer that simple. After changing each zoho to gmail in above exemplary configuration, you still won&#039;t be able to send any mail. You&#039;ll get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msmtp: server message: 534-5.7.14 &amp;lt;https://accounts.google.com/signin/continue?sarp=1&amp;amp;scc=1&amp;amp;plt=...&amp;gt; Please log in via your web browser and then try again.&lt;br /&gt;
msmtp: server message: 534-5.7.14  Learn more at&lt;br /&gt;
msmtp: server message: 534-5.7.14  https://support.google.com/mail/answer/78754 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll receive e-mail titled &amp;quot;Sign-in attempt prevented&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You have to [https://www.google.com/settings/security/lesssecureapps turn on less secure apps] if you want to deal with it. If you&#039;re using 2-step verification, then you&#039;ll have to [https://security.google.com/settings/security/apppasswords add app password for msmtp].&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12688</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12688"/>
		<updated>2016-04-20T16:47:34Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Sensors/lm_sensors/Problems - update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&lt;br /&gt;
If you have physical access to screen connected to your machine with AL, it&#039;s nice to have properly configured console.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 encoding ====&lt;br /&gt;
&lt;br /&gt;
To have UTF-8 from OpenRC point of view, you have to set in &amp;lt;code&amp;gt;/etc/rc.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;unicode=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/termencoding&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add termencoding}}&lt;br /&gt;
In fact it&#039;s mostly irrelevant (prove me wrong).&lt;br /&gt;
&lt;br /&gt;
==== Font with polish letters ====&lt;br /&gt;
&lt;br /&gt;
To be able to see polish letters, you have to install &#039;&#039;kbd-misc&#039;&#039; package, set in &amp;lt;code&amp;gt;/etc/conf.d/consolefont&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;consolefont=&amp;quot;lat2-sun16.psfu.gz&amp;quot;&lt;br /&gt;
consoletranslation=&amp;quot;8859-2_to_uni.trans&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/consolefont&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add consolefont}}&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like default &amp;lt;code&amp;gt;default8x16.psf.gz&amp;lt;/code&amp;gt; font, then use &amp;lt;code&amp;gt;lat2-16.psfu.gz&amp;lt;/code&amp;gt; instead. If you&#039;re comfortable with lower letter height, then I suggest using &amp;lt;code&amp;gt;lat2-14.psfu.gz&amp;lt;/code&amp;gt;, which is still readable, yet on my 1920x1200 display increases LINES number from 75 to 85.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 in tmux ====&lt;br /&gt;
&lt;br /&gt;
tmux checks upon start-up whether environment variable &amp;lt;code&amp;gt;LC_ALL&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt;, contain string &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF8&amp;lt;/code&amp;gt; to activate its UTF-8 mode. It can be also triggered by &amp;lt;code&amp;gt;-u&amp;lt;/code&amp;gt; option. Important part is that globally turning on &amp;lt;code&amp;gt;utf8&amp;lt;/code&amp;gt; window option in tmux configuration doesn&#039;t enforce UTF-8 mode.&lt;br /&gt;
&lt;br /&gt;
musl has locale system since v1.1.4, it was incomplete and experimental, but I&#039;m not sure how it is now. The thing is it&#039;s not leveraged by AL and by default you have no &amp;lt;code&amp;gt;LC_*&amp;lt;/code&amp;gt; variables set. In musl built-in default is &amp;lt;code&amp;gt;C.UTF-8&amp;lt;/code&amp;gt;, so we can simply create one file to set &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt; to such default value and it will satisfy tmux check:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/locale.sh|export LC_CTYPE{{=}}C.UTF-8&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Possible alternative is to alias &amp;lt;code&amp;gt;tmux&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;tmux -u&amp;lt;/code&amp;gt;, but it seems clunky.&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&#039;s/\#.*//g;/^[[:space:]]*$/d&#039;&amp;lt;/code&amp;gt; (deleting blank lines).&lt;br /&gt;
{{note|Patch has been sent to alpine-devel ML. http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3432}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
{{note|Problem has been reported to alpine-devel ML: http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3433. File has been removed in commit [http://git.alpinelinux.org/cgit/aports/commit/?id{{=}}05ca027f69eb029ba8ddc97700639dbe5cb3ad91 05ca027f69eb].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mail ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t need my own real mail server (as it&#039;s kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.&lt;br /&gt;
&lt;br /&gt;
==== msmtp ====&lt;br /&gt;
&lt;br /&gt;
After installing &#039;&#039;msmtp&#039;&#039; package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.msmtprc|defaults&lt;br /&gt;
tls on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
logfile ~/.msmtp.log&lt;br /&gt;
auth on&lt;br /&gt;
port 587&lt;br /&gt;
&lt;br /&gt;
account yourname@zoho.com&lt;br /&gt;
from yourname@zoho.com&lt;br /&gt;
user yourname@zoho.com&lt;br /&gt;
host smtp.zoho.com&lt;br /&gt;
&lt;br /&gt;
account default : yourname@zoho.com&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be asked for password every time mail is sent.&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
If you use gmail, then it&#039;s no longer that simple. After changing each zoho to gmail in above exemplary configuration, you still won&#039;t be able to send any mail. You&#039;ll get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msmtp: server message: 534-5.7.14 &amp;lt;https://accounts.google.com/signin/continue?sarp=1&amp;amp;scc=1&amp;amp;plt=...&amp;gt; Please log in via your web browser and then try again.&lt;br /&gt;
msmtp: server message: 534-5.7.14  Learn more at&lt;br /&gt;
msmtp: server message: 534-5.7.14  https://support.google.com/mail/answer/78754 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll receive e-mail titled &amp;quot;Sign-in attempt prevented&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You have to [https://www.google.com/settings/security/lesssecureapps turn on less secure apps] if you want to deal with it. If you&#039;re using 2-step verification, then you&#039;ll have to [https://security.google.com/settings/security/apppasswords add app password for msmtp].&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12687</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12687"/>
		<updated>2016-04-19T22:08:45Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Sensors/lm_sensors/Problems - update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&lt;br /&gt;
If you have physical access to screen connected to your machine with AL, it&#039;s nice to have properly configured console.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 encoding ====&lt;br /&gt;
&lt;br /&gt;
To have UTF-8 from OpenRC point of view, you have to set in &amp;lt;code&amp;gt;/etc/rc.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;unicode=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/termencoding&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add termencoding}}&lt;br /&gt;
In fact it&#039;s mostly irrelevant (prove me wrong).&lt;br /&gt;
&lt;br /&gt;
==== Font with polish letters ====&lt;br /&gt;
&lt;br /&gt;
To be able to see polish letters, you have to install &#039;&#039;kbd-misc&#039;&#039; package, set in &amp;lt;code&amp;gt;/etc/conf.d/consolefont&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;consolefont=&amp;quot;lat2-sun16.psfu.gz&amp;quot;&lt;br /&gt;
consoletranslation=&amp;quot;8859-2_to_uni.trans&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/consolefont&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add consolefont}}&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like default &amp;lt;code&amp;gt;default8x16.psf.gz&amp;lt;/code&amp;gt; font, then use &amp;lt;code&amp;gt;lat2-16.psfu.gz&amp;lt;/code&amp;gt; instead. If you&#039;re comfortable with lower letter height, then I suggest using &amp;lt;code&amp;gt;lat2-14.psfu.gz&amp;lt;/code&amp;gt;, which is still readable, yet on my 1920x1200 display increases LINES number from 75 to 85.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 in tmux ====&lt;br /&gt;
&lt;br /&gt;
tmux checks upon start-up whether environment variable &amp;lt;code&amp;gt;LC_ALL&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt;, contain string &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF8&amp;lt;/code&amp;gt; to activate its UTF-8 mode. It can be also triggered by &amp;lt;code&amp;gt;-u&amp;lt;/code&amp;gt; option. Important part is that globally turning on &amp;lt;code&amp;gt;utf8&amp;lt;/code&amp;gt; window option in tmux configuration doesn&#039;t enforce UTF-8 mode.&lt;br /&gt;
&lt;br /&gt;
musl has locale system since v1.1.4, it was incomplete and experimental, but I&#039;m not sure how it is now. The thing is it&#039;s not leveraged by AL and by default you have no &amp;lt;code&amp;gt;LC_*&amp;lt;/code&amp;gt; variables set. In musl built-in default is &amp;lt;code&amp;gt;C.UTF-8&amp;lt;/code&amp;gt;, so we can simply create one file to set &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt; to such default value and it will satisfy tmux check:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/locale.sh|export LC_CTYPE{{=}}C.UTF-8&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Possible alternative is to alias &amp;lt;code&amp;gt;tmux&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;tmux -u&amp;lt;/code&amp;gt;, but it seems clunky.&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&#039;s/\#.*//g;/^[[:space:]]*$/d&#039;&amp;lt;/code&amp;gt; (deleting blank lines).&lt;br /&gt;
{{note|Patch has been sent to alpine-devel ML. http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3432}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
{{note|Problem has been reported to alpine-devel ML. http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3433}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mail ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t need my own real mail server (as it&#039;s kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.&lt;br /&gt;
&lt;br /&gt;
==== msmtp ====&lt;br /&gt;
&lt;br /&gt;
After installing &#039;&#039;msmtp&#039;&#039; package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.msmtprc|defaults&lt;br /&gt;
tls on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
logfile ~/.msmtp.log&lt;br /&gt;
auth on&lt;br /&gt;
port 587&lt;br /&gt;
&lt;br /&gt;
account yourname@zoho.com&lt;br /&gt;
from yourname@zoho.com&lt;br /&gt;
user yourname@zoho.com&lt;br /&gt;
host smtp.zoho.com&lt;br /&gt;
&lt;br /&gt;
account default : yourname@zoho.com&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be asked for password every time mail is sent.&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
If you use gmail, then it&#039;s no longer that simple. After changing each zoho to gmail in above exemplary configuration, you still won&#039;t be able to send any mail. You&#039;ll get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msmtp: server message: 534-5.7.14 &amp;lt;https://accounts.google.com/signin/continue?sarp=1&amp;amp;scc=1&amp;amp;plt=...&amp;gt; Please log in via your web browser and then try again.&lt;br /&gt;
msmtp: server message: 534-5.7.14  Learn more at&lt;br /&gt;
msmtp: server message: 534-5.7.14  https://support.google.com/mail/answer/78754 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll receive e-mail titled &amp;quot;Sign-in attempt prevented&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You have to [https://www.google.com/settings/security/lesssecureapps turn on less secure apps] if you want to deal with it. If you&#039;re using 2-step verification, then you&#039;ll have to [https://security.google.com/settings/security/apppasswords add app password for msmtp].&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12686</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12686"/>
		<updated>2016-04-19T21:43:51Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Sensors/lm_sensors/Problems - update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&lt;br /&gt;
If you have physical access to screen connected to your machine with AL, it&#039;s nice to have properly configured console.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 encoding ====&lt;br /&gt;
&lt;br /&gt;
To have UTF-8 from OpenRC point of view, you have to set in &amp;lt;code&amp;gt;/etc/rc.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;unicode=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/termencoding&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add termencoding}}&lt;br /&gt;
In fact it&#039;s mostly irrelevant (prove me wrong).&lt;br /&gt;
&lt;br /&gt;
==== Font with polish letters ====&lt;br /&gt;
&lt;br /&gt;
To be able to see polish letters, you have to install &#039;&#039;kbd-misc&#039;&#039; package, set in &amp;lt;code&amp;gt;/etc/conf.d/consolefont&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;consolefont=&amp;quot;lat2-sun16.psfu.gz&amp;quot;&lt;br /&gt;
consoletranslation=&amp;quot;8859-2_to_uni.trans&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/consolefont&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add consolefont}}&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like default &amp;lt;code&amp;gt;default8x16.psf.gz&amp;lt;/code&amp;gt; font, then use &amp;lt;code&amp;gt;lat2-16.psfu.gz&amp;lt;/code&amp;gt; instead. If you&#039;re comfortable with lower letter height, then I suggest using &amp;lt;code&amp;gt;lat2-14.psfu.gz&amp;lt;/code&amp;gt;, which is still readable, yet on my 1920x1200 display increases LINES number from 75 to 85.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 in tmux ====&lt;br /&gt;
&lt;br /&gt;
tmux checks upon start-up whether environment variable &amp;lt;code&amp;gt;LC_ALL&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt;, contain string &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF8&amp;lt;/code&amp;gt; to activate its UTF-8 mode. It can be also triggered by &amp;lt;code&amp;gt;-u&amp;lt;/code&amp;gt; option. Important part is that globally turning on &amp;lt;code&amp;gt;utf8&amp;lt;/code&amp;gt; window option in tmux configuration doesn&#039;t enforce UTF-8 mode.&lt;br /&gt;
&lt;br /&gt;
musl has locale system since v1.1.4, it was incomplete and experimental, but I&#039;m not sure how it is now. The thing is it&#039;s not leveraged by AL and by default you have no &amp;lt;code&amp;gt;LC_*&amp;lt;/code&amp;gt; variables set. In musl built-in default is &amp;lt;code&amp;gt;C.UTF-8&amp;lt;/code&amp;gt;, so we can simply create one file to set &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt; to such default value and it will satisfy tmux check:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/locale.sh|export LC_CTYPE{{=}}C.UTF-8&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Possible alternative is to alias &amp;lt;code&amp;gt;tmux&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;tmux -u&amp;lt;/code&amp;gt;, but it seems clunky.&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&#039;s/\#.*//g;/^[[:space:]]*$/d&#039;&amp;lt;/code&amp;gt; (deleting blank lines).&lt;br /&gt;
{{note|Patch has been sent. http://thread.gmane.org/gmane.linux.distributions.alpine.devel/3432}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
{{todo|Report this issue on alpine-devel ML.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mail ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t need my own real mail server (as it&#039;s kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.&lt;br /&gt;
&lt;br /&gt;
==== msmtp ====&lt;br /&gt;
&lt;br /&gt;
After installing &#039;&#039;msmtp&#039;&#039; package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.msmtprc|defaults&lt;br /&gt;
tls on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
logfile ~/.msmtp.log&lt;br /&gt;
auth on&lt;br /&gt;
port 587&lt;br /&gt;
&lt;br /&gt;
account yourname@zoho.com&lt;br /&gt;
from yourname@zoho.com&lt;br /&gt;
user yourname@zoho.com&lt;br /&gt;
host smtp.zoho.com&lt;br /&gt;
&lt;br /&gt;
account default : yourname@zoho.com&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be asked for password every time mail is sent.&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
If you use gmail, then it&#039;s no longer that simple. After changing each zoho to gmail in above exemplary configuration, you still won&#039;t be able to send any mail. You&#039;ll get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msmtp: server message: 534-5.7.14 &amp;lt;https://accounts.google.com/signin/continue?sarp=1&amp;amp;scc=1&amp;amp;plt=...&amp;gt; Please log in via your web browser and then try again.&lt;br /&gt;
msmtp: server message: 534-5.7.14  Learn more at&lt;br /&gt;
msmtp: server message: 534-5.7.14  https://support.google.com/mail/answer/78754 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll receive e-mail titled &amp;quot;Sign-in attempt prevented&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You have to [https://www.google.com/settings/security/lesssecureapps turn on less secure apps] if you want to deal with it. If you&#039;re using 2-step verification, then you&#039;ll have to [https://security.google.com/settings/security/apppasswords add app password for msmtp].&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12685</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12685"/>
		<updated>2016-04-19T18:43:54Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Console/tmux&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&lt;br /&gt;
If you have physical access to screen connected to your machine with AL, it&#039;s nice to have properly configured console.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 encoding ====&lt;br /&gt;
&lt;br /&gt;
To have UTF-8 from OpenRC point of view, you have to set in &amp;lt;code&amp;gt;/etc/rc.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;unicode=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/termencoding&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add termencoding}}&lt;br /&gt;
In fact it&#039;s mostly irrelevant (prove me wrong).&lt;br /&gt;
&lt;br /&gt;
==== Font with polish letters ====&lt;br /&gt;
&lt;br /&gt;
To be able to see polish letters, you have to install &#039;&#039;kbd-misc&#039;&#039; package, set in &amp;lt;code&amp;gt;/etc/conf.d/consolefont&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;consolefont=&amp;quot;lat2-sun16.psfu.gz&amp;quot;&lt;br /&gt;
consoletranslation=&amp;quot;8859-2_to_uni.trans&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/consolefont&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add consolefont}}&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like default &amp;lt;code&amp;gt;default8x16.psf.gz&amp;lt;/code&amp;gt; font, then use &amp;lt;code&amp;gt;lat2-16.psfu.gz&amp;lt;/code&amp;gt; instead. If you&#039;re comfortable with lower letter height, then I suggest using &amp;lt;code&amp;gt;lat2-14.psfu.gz&amp;lt;/code&amp;gt;, which is still readable, yet on my 1920x1200 display increases LINES number from 75 to 85.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 in tmux ====&lt;br /&gt;
&lt;br /&gt;
tmux checks upon start-up whether environment variable &amp;lt;code&amp;gt;LC_ALL&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt;, or if it&#039;s empty then &amp;lt;code&amp;gt;LANG&amp;lt;/code&amp;gt;, contain string &amp;lt;code&amp;gt;UTF-8&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;UTF8&amp;lt;/code&amp;gt; to activate its UTF-8 mode. It can be also triggered by &amp;lt;code&amp;gt;-u&amp;lt;/code&amp;gt; option. Important part is that globally turning on &amp;lt;code&amp;gt;utf8&amp;lt;/code&amp;gt; window option in tmux configuration doesn&#039;t enforce UTF-8 mode.&lt;br /&gt;
&lt;br /&gt;
musl has locale system since v1.1.4, it was incomplete and experimental, but I&#039;m not sure how it is now. The thing is it&#039;s not leveraged by AL and by default you have no &amp;lt;code&amp;gt;LC_*&amp;lt;/code&amp;gt; variables set. In musl built-in default is &amp;lt;code&amp;gt;C.UTF-8&amp;lt;/code&amp;gt;, so we can simply create one file to set &amp;lt;code&amp;gt;LC_CTYPE&amp;lt;/code&amp;gt; to such default value and it will satisfy tmux check:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/locale.sh|export LC_CTYPE{{=}}C.UTF-8&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Possible alternative is to alias &amp;lt;code&amp;gt;tmux&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;tmux -u&amp;lt;/code&amp;gt;, but it seems clunky.&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&#039;s/\#.*//g;/^[ \t]*$/d&#039;&amp;lt;/code&amp;gt; (deleting empty lines).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{todo|Report both issues on alpine-devel ML.}}&lt;br /&gt;
&lt;br /&gt;
=== Mail ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t need my own real mail server (as it&#039;s kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.&lt;br /&gt;
&lt;br /&gt;
==== msmtp ====&lt;br /&gt;
&lt;br /&gt;
After installing &#039;&#039;msmtp&#039;&#039; package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.msmtprc|defaults&lt;br /&gt;
tls on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
logfile ~/.msmtp.log&lt;br /&gt;
auth on&lt;br /&gt;
port 587&lt;br /&gt;
&lt;br /&gt;
account yourname@zoho.com&lt;br /&gt;
from yourname@zoho.com&lt;br /&gt;
user yourname@zoho.com&lt;br /&gt;
host smtp.zoho.com&lt;br /&gt;
&lt;br /&gt;
account default : yourname@zoho.com&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be asked for password every time mail is sent.&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
If you use gmail, then it&#039;s no longer that simple. After changing each zoho to gmail in above exemplary configuration, you still won&#039;t be able to send any mail. You&#039;ll get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msmtp: server message: 534-5.7.14 &amp;lt;https://accounts.google.com/signin/continue?sarp=1&amp;amp;scc=1&amp;amp;plt=...&amp;gt; Please log in via your web browser and then try again.&lt;br /&gt;
msmtp: server message: 534-5.7.14  Learn more at&lt;br /&gt;
msmtp: server message: 534-5.7.14  https://support.google.com/mail/answer/78754 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll receive e-mail titled &amp;quot;Sign-in attempt prevented&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You have to [https://www.google.com/settings/security/lesssecureapps turn on less secure apps] if you want to deal with it. If you&#039;re using 2-step verification, then you&#039;ll have to [https://security.google.com/settings/security/apppasswords add app password for msmtp].&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12684</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12684"/>
		<updated>2016-04-18T22:05:00Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Console&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&lt;br /&gt;
If you have physical access to screen connected to your machine with AL, it&#039;s nice to have properly configured console.&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 encoding ====&lt;br /&gt;
&lt;br /&gt;
To have UTF-8 from OpenRC point of view, you have to set in &amp;lt;code&amp;gt;/etc/rc.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;unicode=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/termencoding&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add termencoding}}&lt;br /&gt;
In fact it&#039;s mostly irrelevant (prove me wrong).&lt;br /&gt;
&lt;br /&gt;
==== Font with polish letters ====&lt;br /&gt;
&lt;br /&gt;
To be able to see polish letters, you have to install &#039;&#039;kbd-misc&#039;&#039; package, set in &amp;lt;code&amp;gt;/etc/conf.d/consolefont&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;consolefont=&amp;quot;lat2-sun16.psfu.gz&amp;quot;&lt;br /&gt;
consoletranslation=&amp;quot;8859-2_to_uni.trans&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add &amp;lt;code&amp;gt;/etc/init.d/consolefont&amp;lt;/code&amp;gt; to autostart:&lt;br /&gt;
{{cmd|rc-update add consolefont}}&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like default &amp;lt;code&amp;gt;default8x16.psf.gz&amp;lt;/code&amp;gt; font, then use &amp;lt;code&amp;gt;lat2-16.psfu.gz&amp;lt;/code&amp;gt; instead. If you&#039;re comfortable with lower letter height, then I suggest using &amp;lt;code&amp;gt;lat2-14.psfu.gz&amp;lt;/code&amp;gt;, which is still readable, yet on my 1920x1200 display increases LINES number from 75 to 85.&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&#039;s/\#.*//g;/^[ \t]*$/d&#039;&amp;lt;/code&amp;gt; (deleting empty lines).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{todo|Report both issues on alpine-devel ML.}}&lt;br /&gt;
&lt;br /&gt;
=== Mail ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t need my own real mail server (as it&#039;s kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.&lt;br /&gt;
&lt;br /&gt;
==== msmtp ====&lt;br /&gt;
&lt;br /&gt;
After installing &#039;&#039;msmtp&#039;&#039; package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.msmtprc|defaults&lt;br /&gt;
tls on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
logfile ~/.msmtp.log&lt;br /&gt;
auth on&lt;br /&gt;
port 587&lt;br /&gt;
&lt;br /&gt;
account yourname@zoho.com&lt;br /&gt;
from yourname@zoho.com&lt;br /&gt;
user yourname@zoho.com&lt;br /&gt;
host smtp.zoho.com&lt;br /&gt;
&lt;br /&gt;
account default : yourname@zoho.com&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be asked for password every time mail is sent.&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
If you use gmail, then it&#039;s no longer that simple. After changing each zoho to gmail in above exemplary configuration, you still won&#039;t be able to send any mail. You&#039;ll get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msmtp: server message: 534-5.7.14 &amp;lt;https://accounts.google.com/signin/continue?sarp=1&amp;amp;scc=1&amp;amp;plt=...&amp;gt; Please log in via your web browser and then try again.&lt;br /&gt;
msmtp: server message: 534-5.7.14  Learn more at&lt;br /&gt;
msmtp: server message: 534-5.7.14  https://support.google.com/mail/answer/78754 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll receive e-mail titled &amp;quot;Sign-in attempt prevented&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You have to [https://www.google.com/settings/security/lesssecureapps turn on less secure apps] if you want to deal with it. If you&#039;re using 2-step verification, then you&#039;ll have to [https://security.google.com/settings/security/apppasswords add app password for msmtp].&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12683</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12683"/>
		<updated>2016-04-18T19:50:08Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Mail&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&#039;s/\#.*//g;/^[ \t]*$/d&#039;&amp;lt;/code&amp;gt; (deleting empty lines).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{todo|Report both issues on alpine-devel ML.}}&lt;br /&gt;
&lt;br /&gt;
=== Mail ===&lt;br /&gt;
&lt;br /&gt;
I don&#039;t need my own real mail server (as it&#039;s kind of PITA to set it up properly nowadays). Simple MTA is good enough. In the old days I used ssmtp, but it stopped being maintained (apparently debian devs maintain it now), so I switched to msmtp.&lt;br /&gt;
&lt;br /&gt;
==== msmtp ====&lt;br /&gt;
&lt;br /&gt;
After installing &#039;&#039;msmtp&#039;&#039; package, you need to create configuration file in your home directory. You can find example for Zoho Mail account.&lt;br /&gt;
&lt;br /&gt;
{{Cat|~/.msmtprc|defaults&lt;br /&gt;
tls on&lt;br /&gt;
tls_trust_file /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
logfile ~/.msmtp.log&lt;br /&gt;
auth on&lt;br /&gt;
port 587&lt;br /&gt;
&lt;br /&gt;
account yourname@zoho.com&lt;br /&gt;
from yourname@zoho.com&lt;br /&gt;
user yourname@zoho.com&lt;br /&gt;
host smtp.zoho.com&lt;br /&gt;
&lt;br /&gt;
account default : yourname@zoho.com&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be asked for password every time mail is sent.&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
If you use gmail, then it&#039;s no longer that simple. After changing each zoho to gmail in above exemplary configuration, you still won&#039;t be able to send any mail. You&#039;ll get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;msmtp: server message: 534-5.7.14 &amp;lt;https://accounts.google.com/signin/continue?sarp=1&amp;amp;scc=1&amp;amp;plt=...&amp;gt; Please log in via your web browser and then try again.&lt;br /&gt;
msmtp: server message: 534-5.7.14  Learn more at&lt;br /&gt;
msmtp: server message: 534-5.7.14  https://support.google.com/mail/answer/78754 ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and you&#039;ll receive e-mail titled &amp;quot;Sign-in attempt prevented&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You have to [https://www.google.com/settings/security/lesssecureapps turn on less secure apps] if you want to deal with it. If you&#039;re using 2-step verification, then you&#039;ll have to [https://security.google.com/settings/security/apppasswords add app password for msmtp].&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12681</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12681"/>
		<updated>2016-04-17T18:10:14Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Use Cat and cmd templates (but not everywhere, because cmd requires too much escaping to be convenient).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mv /etc/profile.d/color_prompt{,.sh}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/profile.d/long_history.sh|export HISTSIZE{{=}}9999999&lt;br /&gt;
export HISTFILESIZE{{=}}$HISTSIZE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&#039;s/\#.*//g;/^[ \t]*$/d&#039;&amp;lt;/code&amp;gt; (deleting empty lines).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{todo|Report both issues on alpine-devel ML.}}&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12678</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12678"/>
		<updated>2016-04-15T22:56:44Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Sensors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /etc/profile.d/color_prompt{,.sh}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/profile.d/long_history.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export HISTSIZE=9999999&lt;br /&gt;
export HISTFILESIZE=$HISTSIZE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
==== lm_sensors ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add lm_sensors&lt;br /&gt;
&lt;br /&gt;
# install package for detecting sensors (if needed) - installs perl too&lt;br /&gt;
apk add lm_sensors-detect&lt;br /&gt;
&lt;br /&gt;
# load module required for detecting sensors&lt;br /&gt;
modprobe i2c-dev&lt;br /&gt;
&lt;br /&gt;
# detect sensors (skip scanning Super I/O, IPMI, ISA if you&#039;re on grsec)&lt;br /&gt;
sensors-detect&lt;br /&gt;
&lt;br /&gt;
# after detecting sensors you can remove perl (if you don&#039;t need it)&lt;br /&gt;
apk del perl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Problems =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;sensors-detect&amp;lt;/code&amp;gt; command created &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; file, but its first line is a comment, which leads to following message during boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modprobe: ERROR: missing parameters. See -h.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It can be fixed by improving sed command in &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;&#039;s/\#.*//g&#039;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&#039;s/\#.*//g;/^[ \t]*$/d&#039;&amp;lt;/code&amp;gt; (deleting empty lines).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;It seems that nowadays you don&#039;t have to add &amp;lt;code&amp;gt;lm_sensors&amp;lt;/code&amp;gt; to autostart, because in AL &#039;&#039;lm_sensors&#039;&#039; package is patched to create file &amp;lt;code&amp;gt;/etc/modules-load.d/lm_sensors.conf&amp;lt;/code&amp;gt; (files in this directory are inspected by &amp;lt;code&amp;gt;/etc/init.d/modules&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;/etc/init.d/lm_sensors&amp;lt;/code&amp;gt; seems in fact superfluous and it also doesn&#039;t work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * /etc/conf.d/lm_sensors does not exist, try running sensors-detect&lt;br /&gt;
 * ERROR: lm_sensors failed to start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
because it expects old file (&amp;lt;code&amp;gt;/etc/conf.d/lm_sensors&amp;lt;/code&amp;gt;), which is no longer provided.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{todo|Report both issues on alpine-devel ML.}}&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12677</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12677"/>
		<updated>2016-04-15T21:16:07Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Disk/RAID1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /etc/profile.d/color_prompt{,.sh}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/profile.d/long_history.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export HISTSIZE=9999999&lt;br /&gt;
export HISTFILESIZE=$HISTSIZE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Set up RAID1 on two devices ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add mdadm&lt;br /&gt;
&lt;br /&gt;
# load &amp;quot;raid1&amp;quot; module during boot (not really needed if you perform further steps)&lt;br /&gt;
echo raid1 &amp;gt;&amp;gt;/etc/modules&lt;br /&gt;
&lt;br /&gt;
# create RAID1 array on two whole disks with 1MB data offset&lt;br /&gt;
mdadm --create --level=1 --raid-devices=2 --data-offset=1M /dev/md0 /dev/sda /dev/sdb&lt;br /&gt;
&lt;br /&gt;
# preserve original example mdadm.conf&lt;br /&gt;
mv /etc/mdadm.conf{,.orig}&lt;br /&gt;
&lt;br /&gt;
# save current setup into configuration file&lt;br /&gt;
# (usually people do not use -v, but it&#039;s more readable)&lt;br /&gt;
mdadm --detail -v --scan &amp;gt;/etc/mdadm.conf&lt;br /&gt;
&lt;br /&gt;
# add raid devices starting to autostart&lt;br /&gt;
rc-update add mdadm-raid&lt;br /&gt;
&lt;br /&gt;
# add raid devices monitoring to autostart&lt;br /&gt;
rc-update add mdadm&lt;br /&gt;
&lt;br /&gt;
# start raid devices monitoring now&lt;br /&gt;
/etc/init.d/mdadm start&lt;br /&gt;
&lt;br /&gt;
# following steps are needed if you want to support RAID early during boot&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid&amp;quot; to features (space-separated values)&lt;br /&gt;
vi /etc/mkinitfs/mkinitfs.conf&lt;br /&gt;
&lt;br /&gt;
# rebuild /boot/initramfs-grsec&lt;br /&gt;
mkinitfs&lt;br /&gt;
&lt;br /&gt;
# add &amp;quot;raid1&amp;quot; to modules (comma-separated values)&lt;br /&gt;
vi /etc/update-extlinux.conf&lt;br /&gt;
&lt;br /&gt;
# update extlinux&lt;br /&gt;
update-extlinux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12676</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12676"/>
		<updated>2016-04-15T20:37:45Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Disk/smartd&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /etc/profile.d/color_prompt{,.sh}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/profile.d/long_history.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export HISTSIZE=9999999&lt;br /&gt;
export HISTFILESIZE=$HISTSIZE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
==== Install smartctl and smartd ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# install package&lt;br /&gt;
apk add smartmontools&lt;br /&gt;
&lt;br /&gt;
# comment DEVICESCAN and uncomment DEVICESCAN -R 194 -R 231 -I 9&lt;br /&gt;
# to get meaningful and useful raw temperature in syslog&lt;br /&gt;
vi /etc/smartd.conf&lt;br /&gt;
&lt;br /&gt;
# add smartd service to autostart&lt;br /&gt;
rc-update add smartd&lt;br /&gt;
&lt;br /&gt;
# start the service now&lt;br /&gt;
/etc/init.d/smartd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc&amp;diff=12675</id>
		<title>User:Przemoc</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc&amp;diff=12675"/>
		<updated>2016-04-15T20:20:55Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: Link my notes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Przemoc/Notes]]&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12674</id>
		<title>User:Przemoc/Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Przemoc/Notes&amp;diff=12674"/>
		<updated>2016-04-15T20:19:05Z</updated>

		<summary type="html">&lt;p&gt;Przemoc: AL 3.3.3: Shell&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I finally installed AL and I&#039;m poking it a bit. Here you can find some notes regarding this experience. They should be helpful, but please use them with caution. I may add some additional commentary sometimes. If you think there is a better way to perform some of mentioned here tasks, then don&#039;t hesitate to notify me about it. Top-level headings denotes AL version that was used. Backward and forward compatibility is possible, but not tested.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Alpine Linux 3.3.3 ==&lt;br /&gt;
&lt;br /&gt;
=== Shell ===&lt;br /&gt;
&lt;br /&gt;
Even though I always try to write POSIX sh-compliant scripts, I like to have &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; as my default shell, because it&#039;s quite handy. Being able to write for instance quick &amp;lt;code&amp;gt;diff -u &amp;lt;(COMMAND1) &amp;lt;(COMMAND2)&amp;lt;/code&amp;gt; (to compare output of two commands) or &amp;lt;code&amp;gt;mv FILE{,SUFFIX}&amp;lt;/code&amp;gt; (to rename file by adding suffix) is very convenient.&lt;br /&gt;
&lt;br /&gt;
==== Bash as default shell ====&lt;br /&gt;
&lt;br /&gt;
AL doesn&#039;t have &amp;lt;code&amp;gt;vipw&amp;lt;/code&amp;gt;, so root has to perform &amp;lt;code&amp;gt;vi /etc/passwd&amp;lt;/code&amp;gt; himself to change the last field of root record (should be the first line in the file). You have to install &#039;&#039;util-linux&#039;&#039; package to get &amp;lt;code&amp;gt;chsh&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
==== Activate color prompt ====&lt;br /&gt;
&lt;br /&gt;
Initial prompt: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;baytrail:~# &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /etc/profile.d/color_prompt{,.sh}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prompt after above change and relogin: &amp;lt;code style=&amp;quot;background-color:black;color:gray;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;baytrail [&amp;lt;/span&amp;gt;~&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;]#&amp;lt;/span&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Long history ====&lt;br /&gt;
&lt;br /&gt;
I like to have long history, so I created following file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/profile.d/long_history.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export HISTSIZE=9999999&lt;br /&gt;
export HISTFILESIZE=$HISTSIZE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Przemoc</name></author>
	</entry>
</feed>