# rc script not executed on system boot



## rforberger (Jul 13, 2020)

Hi,

I have a problem that one of my rc scripts which I have enabled in rc.conf is not executed on system boot.

It's about the rc script mfsmaster which is part of the MooseFS cluster file system.

I have in my rc.conf file:


```
mfsmaster_enable="YES"
mfsmetalogger_enable="YES"
mfschunkserver_enable="YES"
```

but mfsmaster is not started on system boot.

I can manually start /usr/local/etc/rc.d/mfsmaster though. 

Any ideas what could be the reason, why it's not started on system boot?

Best regards,
rforberger


----------



## SirDice (Jul 13, 2020)

Look in /var/log/messages for clues why it failed to start during boot.


----------



## rforberger (Jul 13, 2020)

SirDice 
Thanks for your reply. 
When looking in /var/log/messages I see nothing from mfsmaster being started. The rc script just seems not executed on system boot.


----------



## SirDice (Jul 13, 2020)

rforberger said:


> The rc script just seems not executed on system boot.


Does it show up in `rcorder /etc/rc.d/* /usr/local/etc/rc.d/*`?


----------



## rforberger (Jul 13, 2020)

> Does it show up in rcorder /etc/rc.d/* /usr/local/etc/rc.d/*?



Yes, as per:


```
$ rcorder /etc/rc.d/* /usr/local/etc/rc.d/* | grep mfs
/usr/local/etc/rc.d/mfsmaster
/usr/local/etc/rc.d/mfsmetalogger
/usr/local/etc/rc.d/mfschunkserver
```

but it's not started on system boot.


----------



## Mjölnir (Jul 13, 2020)

> I can manually start /usr/local/etc/rc.d/mfsmaster though.


You mean call it as _root_, thus it has the executable flag set?  What does `service mfsmaster start` tell you? `service -e|grep mfs`


----------



## SirDice (Jul 13, 2020)

All  the service(8) command does is start the appropriate /usr/local/etc/rc.d/ script. There is no difference between starting a service like this: `server something start` or `/usr/local/etc/rc.d/something start`. They both do the exact same thing.


----------



## rforberger (Jul 13, 2020)

Hi mjollnir ,
Yes, the executable flag is set on the rc script.

```
# ls -lah /usr/local/etc/rc.d/mfsmaster
-rwxr-xr-x  1 root  wheel   603B  6 Juli 13:04 /usr/local/etc/rc.d/mfsmaster
```

`service mfmaster start` will start the mfsmaster daemon as expected.

`service -e | grep mfs` only lists the mfschunkserver and mfsmetalogger though.


```
# service -e | grep mfs
/usr/local/etc/rc.d/mfsmetalogger
/usr/local/etc/rc.d/mfschunkserver
```


----------



## Mjölnir (Jul 13, 2020)

Then it's a typo. S/th like _mfs_master_enable_ vs. _mfsmaster_enable_ or _mfsmaster_enabled_ with a superfluous "d".


----------



## rforberger (Jul 13, 2020)

mjollnir said:


> Then it's a typo. S/th like _mfs_master_enable_ vs. _mfsmaster_enable_ or _mfsmaster_enabled_ with a superfluous "d".



Well, my rc.conf seems correct:


```
# cat /etc/rc.conf | grep mfs
mfsmaster_enable="YES"
mfsmetalogger_enable="YES"
mfschunkserver_enable="YES"
```

Maybe any special character in rc.conf could cause the problem?


----------



## rforberger (Jul 13, 2020)

I removed the KEYWORD nostart from the script /usr/local/etc/rc.d/mfsmaster.

`....
# KEYWORD: nostart shutdown
....`

No idea, why this keyword is specified there.

Now the mfsmaster service will start on system boot.

Thanks for your help.


----------



## Mjölnir (Jul 13, 2020)

This thread deserves 1st rank in _July's most weird bugs_.    Do not hesiate to file in a bug report on that port.


----------



## SirDice (Jul 13, 2020)

rforberger said:


> No idea, why this keyword is specified there.


Looks like it was added a few years ago, don't know  why though.




__





						[ports] Diff of /head/sysutils/moosefs2-master/files/mfsmaster.in
					






					svnweb.freebsd.org


----------



## rforberger (Jul 13, 2020)

SirDice said:


> Looks like it was added a few years ago, don't know  why though.
> 
> 
> 
> ...



Ok, thanks for checking up on this. Actually I am using moosefs3. But the nostart keywork still seems to be in place with moosefs3. I will ask the maintainer of the package, if it gets added on updates etc again.


----------



## SirDice (Jul 13, 2020)

rforberger said:


> But the nostart keywork still seems to be in place with moosefs3.


I think they just copied the  original  ports  and modified them for the version. So they copied this too.  



rforberger said:


> I will ask the maintainer of the package


Yes, that's the best way forward.


----------



## Zamana (May 31, 2022)

Almost 2 years later and this issue is still around...

Thanks for the KEYWORD enchantment...


----------



## Jose (May 31, 2022)

Looks like that port is maintained by the Moosefs upstream:





						199342 – sysutils/moosefs-master: Update to 2.0.72-1
					






					bugs.freebsd.org
				




Earliest checkin I can find with the `nostart` keyword is this:








						MooseFS 2.0.60-1 · moosefs/moosefs@9816c2b
					

This is a first MooseFS release on GitHub   * (all) changed license of standard version to GPLv2  * (all) changed name moosefs-ce to just moosefs




					github.com
				




It's still there in Moosefs 3:








						moosefs/mfsmaster.in at master · moosefs/moosefs
					

MooseFS – Open Source, Petabyte, Fault-Tolerant, Highly Performing, Scalable Network Distributed File System (Software-Defined Storage) - moosefs/mfsmaster.in at master · moosefs/moosefs




					github.com
				




I'd file a bug on their Github project.


----------

