Subject: [alpine-user] How do I add openssh to the packages that are loaded at boot time?

From: Andrew Stuart <[email-masked]>
Date: Thu, 27 Oct 2016 06:34:06 +1100

It seems that Alpine Linux loads packages up when it boots. How do I add openssh to the packages that are loaded at boot time?

thanks!

When I am logged in I do "apk info" which lists 16 packages as follows:

localhost:~# apk info
musl
busybox
alpine-baselayout
openrc
alpine-conf
zlib
libcrypto1.0
libssl1.0
apk-tools
busybox-suid
busybox-initscripts
scanelf
musl-utils
libc-utils
alpine-keys
alpine-base
localhost:~#

The following messages from the boot log show these 16 packages being loaded:

* Installing packages to root filesystem: (1/16) Installing musl (1.1.14-r12)
7  0% [                                           ][    3.787784] tsc: Refined TSC clocksource calibration: 2600.002 MHz
[    3.788821] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x257a3e40e8d, max_idle_ns: 440795298933 ns
8[0K(2/16) Installing busybox (1.24.2-r11)
7  7% [###                                        ]8[0K7 17% [#######                                    ]8[0KExecuting busybox-1.24.2-r11.post-install
(3/16) Installing alpine-baselayout (3.0.3-r0)
7 18% [########                                   ]8[0KExecuting alpine-baselayout-3.0.3-r0.pre-install
7 18% [########                                   ]8[0K7 19% [########                                   ]8[0K7 20% [########                                   ]8[0KExecuting alpine-baselayout-3.0.3-r0.post-install
(4/16) Installing openrc (0.21-r2)
7 23% [##########                                 ]8[0K7 24% [##########                                 ]8[0K7 25% [##########                                 ]8[0K7 25% [###########                                ]8[0K7 26% [###########                                ]8[0K7 27% [###########                                ]8[0K7 28% [############                               ]8[0K7 29% [############                               ]8[0K7 30% [############                               ]8[0K7 30% [#############                              ]8[0K7 31% [#############                              ]8[0K7 32% [#############                              ]8[0K7 32% [##############                             ]8[0K7 33% [##############                             ]8[0K7 34% [##############                             ]8[0K7 35% [###############                            ]8[0K7 36% [###############                            ]8[0K7 37% [###############                            ]8[0K7 37% [################                           ]8[0K7 38% [################                           ]8[0K7 39% [################                           ]8[0K7 39% [#################                          ]8[0K7 40% [#################                          ]8[0K7 41% [#################                          ]8[0K7 42% [##################                         ]8[0K7 43% [##################                         ]8[0K7 44% [##################                         ]8[0K7 44% [###################                        ]8[0K7 45% [###################                        ]8[0K7 46% [###################                        ]8[0K7 46% [####################                       ]8[0K7 47% [####################                       ]8[0KExecuting openrc-0.21-r2.post-install
(5/16) Installing alpine-conf (3.4.1-r5)
7 49% [#####################                      ]8[0K7 50% [#####################                      ]8[0K7 51% [#####################                      ]8[0K7 51% [######################                     ]8[0K(6/16) Installing zlib (1.2.8-r2)
7 52% [######################                     ]8[0K(7/16) Installing libcrypto1.0 (1.0.2j-r0)
7 53% [######################                     ]8[0K7 80% [##################################         ]8[0K7 81% [###################################        ]8[0K7 82% [###################################        ]8[0K7 83% [###################################        ]8[0K7 83% [####################################       ]8[0K7 84% [####################################       ]8[0K7 85% [####################################       ]8[0K(8/16) Installing libssl1.0 (1.0.2j-r0)
7 85% [####################################       ]8[0K(9/16) Installing apk-tools (2.6.7-r0)
7 91% [#######################################    ]8[0K(10/16) Installing busybox-suid (1.24.2-r11)
7 94% [########################################   ]8[0K(11/16) Installing busybox-initscripts (3.0-r3)
7 94% [########################################   ]8[0K7 95% [########################################   ]8[0K7 95% [#########################################  ]8[0K7 96% [#########################################  ]8[0KExecuting busybox-initscripts-3.0-r3.post-install
(12/16) Installing scanelf (1.1.6-r0)
7 96% [#########################################  ]8[0K(13/16) Installing musl-utils (1.1.14-r12)
7 97% [########################################## ]8[0K7 98% [########################################## ]8[0K(14/16) Installing libc-utils (0.7-r0)
7 99% [########################################## ]8[0K(15/16) Installing alpine-keys (1.1-r0)
7 99% [########################################## ]8[0K(16/16) Installing alpine-base (3.4.4-r0)
7 99% [########################################## ]8[0K7100% [###########################################]8[0KExecuting busybox-1.24.2-r11.trigger
OK: 7 MiB in 16 packages
ok.

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Cág <[email-masked]>
Date: Wed, 26 Oct 2016 21:00:43 +0100

Andrew Stuart wrote:
> It seems that Alpine Linux loads packages up when it boots. How do I
> add openssh to the packages that are loaded at boot time?
> [something that is messed]

Hi,

I'm not really sure what you need. If you need to add services to 
startup
then it's in your case "rc-update add openssh". Read openrc(8), 
rc-status(8),
rc-update(8). Wiki has an article on booting[0].

Hope this helps,
Cág

0: https://wiki.alpinelinux.org/wiki/Alpine_Linux_Init_System

---

---

From: Cág <[email-masked]>
Date: Wed, 26 Oct 2016 21:02:39 +0100

I wrote:
> "rc-update add openssh".

sshd*

---

---

From: Andrew Stuart <[email-masked]>
Date: Thu, 27 Oct 2016 07:07:45 +1100

After doing "rc-update add sshd”, how do I save the package(s) and config that was downloaded and installed, to ensure it starts next time?

The 16 packages that I see being loaded during boot - where do they come from exactly, and what config file tells the system to load those packages?

thanks

as

---

---

From: Steffen Nurpmeso <[email-masked]>
Date: Wed, 26 Oct 2016 21:57:19 +0200

Andrew Stuart <[email-masked]> wrote:
 |It seems that Alpine Linux loads packages up when it boots. How do \
 |I add openssh to the packages that are loaded at boot time?

According to

  https://wiki.alpinelinux.org/wiki/Alpine_Linux_Init_System

i think this was "rc-update add sshd default", but i could be
slightly mistaken.

(And i'm happy i haven't fiddle around too much with that stuff,
i for one really don't like it.  I for one am much in favour of
the traditional BSD-style of system startup, or for the Runit
stuff otherwise.  But also happy Alpine doesn't use systemd.)

--steffen

---

---

From: Cág <[email-masked]>
Date: Wed, 26 Oct 2016 21:06:12 +0100

> i think this was "rc-update add sshd default", but i could be

You are right. And I forgot a runlevel.

> stuff otherwise.  But also happy Alpine doesn't use systemd.)

OpenRC is pretty straightforward to me, probably even more than
sysvinit that I used to use.

Cág

---

---

From: Steffen Nurpmeso <[email-masked]>
Date: Thu, 27 Oct 2016 12:46:45 +0200

Cág <[email-masked]> wrote:
 |Steffen Nurpmeso wrote:
 ...
 |> (And i'm happy i haven't fiddle around too much with that stuff,
 |> i for one really don't like it.  I for one am much in favour of
 |> the traditional BSD-style of system startup, or for the Runit
 |> stuff otherwise.  But also happy Alpine doesn't use systemd.)
 |
 |OpenRC is pretty straightforward to me, probably even more than
 |sysvinit that I used to use.

Yep, don't listen, it is only my personal taste.  I just wondered
some months ago that such a seen-by-many-eyes codebase like OpenRC
that was in use by the major distributions (and their money, and
their development power) was not capable to properly restart the
complete dependeny tree when one of the programs of that failed to
restart -- after being capable of properly stopping that same
tree.  Not that i really care, i started them manually, i just
wondered back then.  And if so, why not simple and central like
FreeBSD (in practice i have almost the same FreeBSD configuration
since 4.7, it still works) or lean and pragmatic, like runit.
My thinking back then.  But i never tinkered with the problems
involved in this area, so...

--steffen

---

---

From: Cág <[email-masked]>
Date: Thu, 27 Oct 2016 19:23:11 +0100

> involved in this area, so...

Not a big deal. Many people here see BSDs as superior to Linux
in some parts. Alpine, as you see, has minimal amount of GNU
components (GCC and make, though I suppose the latter will be replaced
one day with NetBSD's bmake). I use a shell from MirBSD (mksh),
vi from  BSD's (nvi), count here also mandoc from OpenBSD.

Cheers,
Cág

---

---

From: Harald Arnesen <[email-masked]>
Date: Thu, 27 Oct 2016 23:41:25 +0200

> vi from  BSD's (nvi), count here also mandoc from OpenBSD.

So why do you use Linus, not one of the *BSDs instead?
-- 
Hilsen Harald

---

---

From: Cág <[email-masked]>
Date: Sat, 29 Oct 2016 17:45:18 +0100

> So why do you use Linus, not one of the *BSDs instead?

Good question. I actually use it occasionally but prefer Linux for a
number of reasons.

1) File systems. The most popular choice, ext4, is better in both speed 
and
features than UFS. And there is diversity of file systems in Linux.
2) Package management. apk is very simple yet powerful. This should be 
one of the
reasons why I use Alpine actually. Coming from dpkg- or rpm-based, where 
package
making is painful, you would see the difference.
3) Flexibility. It's very easy to rebuild almost an entire system, 
replace
the userland and the kernel. In BSDs you probably aren't supposed to 
replace
your userland. In NetBSD the base install doesn't come as packages.
4) Because I am more familiar with Linux overall and the kernel in 
particular.
Comfort zone, if you want.
5) Hardware support. A couple of years ago I tried to install OpenBSD on 
my
then one year old machine and found out that my wireless card wasn't 
supported
and the driver would be written a year after.

Cág

---

---

From: Levente Kovacs <[email-masked]>
Date: Sat, 29 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NCj4gQ29tZm9ydCB6b25lLCBpZiB5b3Ugd2FudC4NCj4gNSkgSGFyZHdhcmUgc3VwcG9ydC4gQSBjb3VwbGUgb2YgeWVhcnMgYWdvIEkgdHJpZWQgdG8gaW5zdGFsbCBPcGVuQlNEDQo+IG9uIG15DQo+IHRoZW4gb25lIHllYXIgb2xkIG1hY2hpbmUgYW5kIGZvdW5kIG91dCB0aGF0IG15IHdpcmVsZXNzIGNhcmQgd2Fzbid0IA0KPiBzdXBwb3J0ZWQNCj4gYW5kIHRoZSBkcml2ZXIgd291bGQgYmUgd3JpdHRlbiBhIHllYXIgYWZ0ZXIuDQoNCg0KRmFpciBwb2ludHMuDQoNClRoaXMgaXMgd2h5IEkgc3dpdGNoZWQgYmFjayBmcm9tIEZyZWVCU0QgKG9uIGRlc2t0b3ApIHRvIExpbnV4LiBJIHdhcw0KdXNpbmcgaXQgZm9yIG9uZSB5ZWFyLiBUaGVuLCBvbmx5IG15IHNlcnZlciBydW5zIGl0Lg0KDQpIb3dldmVyLCB5b3Ugc2hvdWxkIHRyeSBaRlMuIEl0IGlzIHZlcnkgY29tbW9uIGluICpCU0RzLCBhbmQgaXQgaGFzIGdyZWF0DQpmZWF0dXJlcy4gVHJ1ZU9TIHVzZXMgdGhhdCBmb3IgZXhhbXBsZS4NCg0KTGV2DQo=---Unsubscribe:  [email-masked]:         [email-masked]

---

From: Steffen Nurpmeso <[email-masked]>
Date: Fri, 28 Oct 2016 12:11:37 +0200

Cág <[email-masked]> wrote:
 |Steffen Nurpmeso wrote:
 |> Yep, don't listen, it is only my personal taste.  I just wondered
 ...
 |> FreeBSD (in practice i have almost the same FreeBSD configuration
 |> since 4.7, it still works) or lean and pragmatic, like runit.
 ...
 |
 |Not a big deal. Many people here see BSDs as superior to Linux
 |in some parts. Alpine, as you see, has minimal amount of GNU
 |components (GCC and make, though I suppose the latter will be replaced
 |one day with NetBSD's bmake). I use a shell from MirBSD (mksh),
 |vi from  BSD's (nvi), count here also mandoc from OpenBSD.

I always dreamed of a Linux Kernel with a BSD userland, it is very
homogenous.  I.e., a basic install ships the complete environment
including compilers etc.  E.g., download or buy an ISO, install
locally, and you are done.  FreeBSD has diverged a bit, it
outsources more and more to packages.  (It can be understood from
the support point of view, but...  Good historic stuff in
usr/share etc. was a good reading and overview when i was new, and
what Linux didn't offer at all.  Despite some GNU manuals, but
that is not Unix, right.) On the other hand its kernel "gets
better and better".  But of course it is far from the driver
support etc. that a Linux kernel can offer.  And things like new
cgroup hierarchies with all that is missing.  Etc.  On the other
hand it is missing.  (And with NanoBSD etc. the system could also
be stripped down for server purposes.)

I don't develop on Alpine, i have a VM with all that stuff, but
since an error resulted in some security mechanism to step in and
throttle fork(2) i guess it was so that it all became completely
unusable (and i failed to find any documentation on how i could
turn that off for my session) i am only doing test runs, and
preparation checks before i update the server.  And that runs
absolutely painless and smooth (i have an inotifyd instance that
drives me insane, but which i need to be able to send rotated logs
via mail; unfortunately a very small patch to offer rotation hooks
was not accepted by busybox).  And thanks again to the Alpine
people who noted local.d, i wouldn't have discovered this on my
own!

I think this is the main problem for me with Linux: that it
evolves so fast and i neither have the time nor the will to keep
up, and dig into kernel documentation or worse to be able to
understand what is going on.  E.g., Alpine release announcements
ship with a git shortlog, ArchLinux and CruxLinux with nothing,
though the latter sends notification mails for security
advisories.  FreeBSD, and also OpenBSD, have detailed
announcements with (in the web form) active links that directly
jump to manual pages, and which give hints shall they be
necessary, etc.  For someone like me this is very helpful, and
i very much appreciate the love that can, and is put into that.

Ciao,

--steffen

---

---

From: Lev <[email-masked]>
Date: Fri, 28 Oct 2016 12:24:15 +0200

On Fri, 28 Oct 2016 12:11:37 +0200
Steffen Nurpmeso <[email-masked]> wrote:

[...]
> homogenous.
[...]

You should try Void Linux. I almost switched to Void from Debian, but
when the package manager screwed the system, I went back to Debian. It
was developed by a BSD guy, so it is like a BSD. I hope one day they
fix the package manager issue, and I could say good by to Debian.
I don't use systemd, and I'm quite happy with my Debian as it
is today.

On my home server, of course I run FreeBSD. That is really the best for
my old rig running in the basement.

Lev

---

---

From: Steffen Nurpmeso <[email-masked]>
Date: Fri, 28 Oct 2016 13:02:03 +0200

Lev <[email-masked]> wrote:
 |On Fri, 28 Oct 2016 12:11:37 +0200
 |Steffen Nurpmeso <[email-masked]> wrote:
 |
 |[...]
 |> I always dreamed of a Linux Kernel with a BSD userland, it is very
 |> homogenous.
 |[...]
 |
 |You should try Void Linux. I almost switched to Void from Debian, but
 |when the package manager screwed the system, I went back to Debian. It
 |was developed by a BSD guy, so it is like a BSD. I hope one day they
 |fix the package manager issue, and I could say good by to Debian.
 |I don't use systemd, and I'm quite happy with my Debian as it
 |is today.

Oh yes, Void i have forgotten -- Ypnose was one of the first who
packaged the MUA i maintain.  "It is" definetely not "like a BSD",
but a nice and cute Linux with runit (by default).  I never had
such problems, in fact i really like Xtraemes pretty well, what it
reports and the info it provides!  But using it is not so easy as,
e.g., pacman.  I still have a VM, but my main machine died and
this one can dig only one, maximally two concurrently, and i had
to choose, and ArchLinux has prebuild packages for gcc and clang,
etc., and always the newest.  That is better for developing, and
my machine has not the resources to build, e.g., clang.  But Void
is really great.  Actually i see that they have gained a clang
package in the meanwhile...  A grown set of contributors in the
last one or two years it seems.  Well.  I am waiting for the new
installation medium, and hope for a non-graphical-by-default boot
in the future. ^.^  Yes, Void.  Ever so amazing, with all that
automated environment he built, with the automatic test runs and
all that!

 |On my home server, of course I run FreeBSD. That is really the best for
 |my old rig running in the basement.

Sure.  I am only working in VMs.  With support for that new memory
crypto a very basic Linux system with kvm, vde etc. would be ideal
for me, then FreeBSD and others in the VM, on the work machine.
Especially so if the basis does not even need to provide an
X server, but if that can be directly driven on hardware by a VM,
i seem to remember that this is being worked on.  That's all. ^.^
Ciao,

--steffen

---

---

From: Cág <[email-masked]>
Date: Fri, 28 Oct 2016 13:19:11 +0100

> I always dreamed of a Linux Kernel with a BSD userland, it is very

MirOS and Starch tried to do that, but Starch is dead now and MirOS
is close to that. stali in its beginning was about putting BSD, I 
believe
but can be wrong (so it was before ubase). Also, Busybox is anyway 
better
than GNU, so if you put it on top of the kernel you have more chances to 
succeed.
Here in Alpine we pretty much have the same binary incompatibility with 
glibc.
We can hope musl to become the standard though by looking at how many 
distributions
use it or switched to it, so this isn't some kind of crazy utopia.

The kernels are flexible there too. There is a project that makes NetBSD 
to fit
on a floppy (Alpine by the way started like that).

Alpine makes maintaining a system very easy (for me, comparing to BSD 
and ports)
starting from the package manager and ending with setup-* scripts.

Peace,
Cág

---