How to install custom service/software into scale 24

Hello:

For example, I need
k9s: manage the k3s, Need script in PATH (kubectl → k3s kubectl $@)
xray: setup http-proxy client for containerd, need systemd service file

But I found in scale 24, All fhs folder is readonly (/usr /opt ). So, Question:

It’s there some legit way to install software/service into truenas ?

OFF TOPIC;DR:

Why truenas become more and more enforced encapsulation the system? I know as a system unmodifyable is safe and stable, But:

I can’t pull image without http-proxy, I can’t run it as App.
Install a VM then place k9s in it total wastfull of memory, And if something wrong I can’t even reach it anymore.

Do we have some switch or kernel setting let user decide use which mode (RO mount or RW mount). I mean not every one use TrueNAS in large scal production. Most people like me use it as simple file back/photoprism/pihole dns?

1 Like

The only legit way there’s ever been to do this is via some sort of container–jails under FreeNAS/TrueNAS CORE, and apps (and now pseudo-jails) under SCALE–or in a VM. It’s never been “legit” to add anything to, or modify anything in, the base OS.

You’ve just answered your own question.

That sounds like something that’s worth a feature request, at least IMO.

Yes, this was announced well in advance.

There is, but I don’t find it in the docs–something like enable-dev-mode. @awalkerix ?

Thanks for reply! :smiley:

About legit modify:

I’m using xray project, Its a single execute file, Consume about 40~50M memory.

  • Put http-proxy on another server, With non-HA home server, That’s RAID-0 behiver.
  • Put http-proxy inside k3s (run custom app), If k3s need pull some image to bootup. It can’t.

FYI: In some country can’t access k8s registry and truenas charts, K3S first boot will failed.

About DEV mode:

I think maybe not a DEV mode, DEV mode allow user modify system image, But they will lost when update. If someone else need same feature. The software probley static compiled (Because there is no apt for denpendency install).

As a workaround, I put everything in /root.

Ah, but there is, and IIRC it’s also enabled when you turn on dev mode.

…and that’s really the answer–put your software outside of the system directories.

install-dev-tools or /usr/local/libexec/disable-rootfs-protection

I don’t think this is particularly onerous and has been announced very long time in advance. We’ve disabled apt since BlueFin or angelfish IIRC.

100% agree, but /root is on the boot pool and therefore I consider it a system directory. You have repeatedly argued the boot pool was expendable. (also agree)

Therefore I create a dataset named <mypool>/scripts on each TN installation and that’s where I put my cron jobs, post-init tasks, but also binaries like the Scrutiny agent, stuff from github like Heavyscript, etc.

As long as the necessary framework is present you can actually install anything on TrueNAS. Just not with the standard system package tools (apt or pkg) and in the standard locations. E.g. with python you can create a venv in <yourpool>/scripts, use pip, requirements.txt etc. etc.

HTH,
Patrick

True. Some place on the data pool would be a better choice.

1 Like