# How do I use the SN updater on FreeBSD?

**URL:** <https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064>\
**Category:** getting started\
**Tags:** freebsd, truenas, updater\
**Created:** [July 7, 2022, 5:32pm UTC](https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064 "2022-07-07T17:32:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Storgeez](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/storgeez/32/68_2.png) [@Storgeez](https://forum.storj.io/u/Storgeez)\
**Post date:** [July 7, 2022, 5:32pm UTC](https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064/1 "2022-07-07T17:32:09Z")

</div>

How do I use the SN updater? I finally decided that it should be mature enough and I’m lazy to update anymore so where do I find the instructions? I looked for them but I see only instructions for Watchtower. Can somebody point me to where I can find them?

---

<div class="post-metadata">

**Author:** ![Storgeez](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/storgeez/32/68_2.png) [@Storgeez](https://forum.storj.io/u/Storgeez)\
**Post date:** [July 15, 2022, 1:59pm UTC](https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064/2 "2022-07-15T13:59:23Z")

</div>

@Alexey You have migrated me here but I am not using Linux and systemctl command doesn’t exist…  
Does this mean that there are no instructions?

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [July 15, 2022, 3:14pm UTC](https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064/3 "2022-07-15T15:14:44Z")

</div>

Sorry for that. You didn’t specify what OS are you using. The separate updater is exist only for Linux, BSD and Windows.  
In Windows it’s installed with storagenode. So the alternative is only Linux or BSD 🤷‍♂️  
What’s your OS and what do you want to do?

---

<div class="post-metadata">

**Author:** ![Storgeez](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/storgeez/32/68_2.png) [@Storgeez](https://forum.storj.io/u/Storgeez)\
**Post date:** [July 15, 2022, 6:14pm UTC](https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064/4 "2022-07-15T18:14:51Z")

</div>

Apologies, I didn’t know it had anything to do with the OS, I thought it was just a command, like with storagenode. I’m using FreeBSD, which is how, I assume, you are supporting TrueNAS, as it has been announced years ago and is touted as supported but there was never an app for it. Why is Windows version so simple and integrated, and has installer and non-Windows so manual and laborious?

I just want to use the updater to update the node, instead of doing it manually.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [July 15, 2022, 7:48pm UTC](https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064/5 "2022-07-15T19:48:20Z")

</div>

I do not have an instruction how to setup updater in freeBSD, but you need to setup storagenode as a service first (I think this could help: [Chapter 12. Configuration and Tuning | FreeBSD Documentation Portal](https://docs.freebsd.org/en/books/handbook/config/#_extended_application_configuration))  
The `storagenode-updater` should be installed as service too.  
It should have configuration options:

- `--config-dir` point to the config file of storagenode;
- `--identity-dir` point to the identity folder of storagenode;
- `--binary-location` point to the folder where is storagenode binary located;
- `--service-name` specified a service name of storagenode.

---

<div class="post-metadata">

**Author:** ![arrogantrabbit](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/arrogantrabbit/32/11200_2.png) [@arrogantrabbit](https://forum.storj.io/u/arrogantrabbit)\
**Post date:** [July 25, 2022, 5:02am UTC](https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064/6 "2022-07-25T05:02:41Z")

</div>

> [@Alexey](#):
>
> `--config-dir` point to the config file of storagenode;

Specifying this to an updater seem to cause issues – as updater does not understand (and complains about) half of the parameters for storage node. I have omitted it; my rc script looks like so:

```auto
root@storj:~ # cat /etc/rc.d/storjupd
#!/bin/sh

# PROVIDE: storjupd
# REQUIRE: LOGIN FILESYSTEMS netwait
# KEYWORD: SHUTDOWN

. /etc/rc.subr

name=storjupd
rcvar=${name}_enable

load_rc_config $name
: ${storjupd_enable:=yes}
: ${storjupd_config_dir="/root/.local/share/storj/storagenode"}
: ${storjupd_identity_dir="/root/.local/share/storj/identity/storagenode"}
: ${storjupd_node_binary_location="/usr/local/bin/storagenode"}
: ${storjupd_node_service_name="storj"}

pidfile="/var/run/${name}.pid"
procname="/usr/local/bin/storagenode-updater"
command="/usr/sbin/daemon"
command_args="-f -H -o /var/log/${name}.log \
    -p ${pidfile} -u root ${procname} run \
    --identity-dir ${storjupd_identity_dir}\
    --binary-location ${storjupd_node_binary_location} \
    --service-name ${storjupd_node_service_name}"

# specifying this leads to issues. Is it needed?
#--config-dir ${storjupd_config_dir} 

run_rc_command "$1"

```

Along the same line, it seems to me that the updater should not need identity dir either – why would it need it? Its job is to check versions and update binary.

This is the output I get with the above script:

```auto
root@storj:~ # cat /var/log/storjupd.log
2022-07-24T21:57:53.463-0700	INFO	Running on version	{"Process": "storagenode-updater", "Service": "storagenode-updater", "Version": "v1.58.2"}
2022-07-24T21:57:53.464-0700	INFO	Downloading versions.	{"Process": "storagenode-updater", "Server Address": "https://version.storj.io"}
2022-07-24T21:57:53.685-0700	INFO	Current binary version	{"Process": "storagenode-updater", "Service": "storj", "Version": "v1.58.2"}
2022-07-24T21:57:53.685-0700	INFO	New version is being rolled out but hasn't made it to this node yet	{"Process": "storagenode-updater", "Service": "storj"}
2022-07-24T21:57:53.692-0700	INFO	Current binary version	{"Process": "storagenode-updater", "Service": "storagenode-updater", "Version": "v1.58.2"}
2022-07-24T21:57:53.693-0700	INFO	New version is being rolled out but hasn't made it to this node yet	{"Process": "storagenode-updater", "Service": "storagenode-updater"}

```

Anyway, for completeness, and to help fellow forum users avoid wasting time writing the rc script for Nth time from scratch, here is my storagenode script. It works in FreeBSD 13.1 jail (on TrueNAS 13.1 for that matter)

```auto
root@storj:~ # cat /etc/rc.d/storj
#!/bin/sh

# PROVIDE: storj
# REQUIRE: LOGIN FILESYSTEMS netwait
# KEYWORD: SHUTDOWN

. /etc/rc.subr

name=storj
rcvar=storj_enable

load_rc_config $name
: ${storj_enable:=yes}
: ${storj_msg="Nothing started."}
: ${storj_config_dir="/root/.local/share/storj/storagenode"}
: ${storj_identity_dir="/root/.local/share/storj/identity/storagenode"}

pidfile="/var/run/${name}.pid"
procname="/usr/local/bin/storagenode"
command="/usr/sbin/daemon"
command_args="-f -H -o /var/log/${name}.log \
    -p ${pidfile} -u root ${procname} run \
    --config-dir ${storj_config_dir} \
    --identity-dir ${storj_identity_dir}\
    --log.level info --log.output stdout"

required_dirs="/mnt/storj/blobs"

run_rc_command "$1"

```

Adjust the required\_dirs to the correct mount point, and adjust netwait to ping relevant to your network address.

Snippet from `/etc/rc.conf`:

```auto
storj_enable="YES"
netwait_enable="YES"
netwait_ip=10.0.17.1
newsyslog_enable="YES"
storjupd_enable="YES"

```

While at it, here is the log rotator config:

```auto
root@storj:~ # cat /etc/newsyslog.conf.d/storj.conf
# $FreeBSD$
/var/log/storj.log 600 20 * @T00 J /var/run/storj.pid

```

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [July 25, 2022, 7:03am UTC](https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064/7 "2022-07-25T07:03:42Z")

</div>

Hello @arrogantrabbit ,  
Welcome to the forum!

> [@arrogantrabbit](#):
>
> Specifying this to an updater seem to cause issues – as updater does not understand (and complains about) half of the parameters for storage node.

Yes, it warns about not recognized keys, but they are not errors and not fatal, so can be ignored. The config file is used by the updater mostly for purpose to take a location of the identity and an address of the version control service. Maybe also metrics service (if you agreed to send stats).  
If you specified the identity location and other required parameters and do use a default version control service, I believe it’s safe to do not provide a config location to the updater.

---

<div class="post-metadata">

**Author:** ![Storgeez](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/storgeez/32/68_2.png) [@Storgeez](https://forum.storj.io/u/Storgeez)\
**Post date:** [July 26, 2022, 11:47pm UTC](https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064/8 "2022-07-26T23:47:34Z")

</div>

Fiddling with low-level workings of an operating system is an extremely complex and cumbersome task for a user. I don’t even know if an equivalent of this is viewable in Windows without the source code. I would need to learn the language that this is supposed to be written in (it doesn’t say what it is on this page, probably somewhere else), then learn how this part of the operating system works, then be able to understand these instructiosn and then I could attempt to do this. I would like to see an average Windows SNO do this in Windows - why is there an installer abstraction for them and not for non-Windows?

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [July 27, 2022, 7:26am UTC](https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064/9 "2022-07-27T07:26:38Z")

</div>

> **[Operating System Market Share Worldwide | Statcounter Global Stats](https://gs.statcounter.com/os-market-share)**
>
> This graph shows the market share of operating systems worldwide based on over 10 billion monthly page views.

However, Linux and FreeBSD are Open Source and more friendly for Community participation. So you are welcome to write an installer for FreeBSD/TrueNAS.  
We already have an installer for Linux (Debian-based): [[Tech Preview] Linux Installer Part 2](https://forum.storj.io/t/tech-preview-linux-installer-part-2/13976)

The main problem of other OSes - no uniform installer, even within a Linux ecosystem there are at least two major package systems (but in reality - any distro have an own implementation). This is a nightmare to support all of them.

---

<div class="post-metadata">

**Author:** ![arrogantrabbit](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/arrogantrabbit/32/11200_2.png) [@arrogantrabbit](https://forum.storj.io/u/arrogantrabbit)\
**Post date:** [July 28, 2022, 1:42am UTC](https://forum.storj.io/t/how-do-i-use-the-sn-updater-on-freebsd/19064/10 "2022-07-28T01:42:58Z")

</div>

I’ve improved the scripts (fixed minor issues with restarting the daemon on failure) and posted them here: [GitHub - arrogantrabbit/freebsd\_storj\_installer: Installer script for Store on FreeBSD](https://github.com/arrogantrabbit/freebsd_storj_installer), along with the installer script that will do all the work for you. Tested on FreeBSD 13.1-RELEASE jail.
