Hi Jasper,

Good job. As tested, salt_minion now starts even without swap area configured. 
Excellent!

Martin

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, August 3, 2020 1:29 PM, Jasper Lievisse Adriaanse <j...@jasper.la> 
wrote:

> On Sat, Aug 01, 2020 at 10:43:09AM +0000, Martin wrote:
>
> > I did new VM with 6.7-current without swap.
> > salt_minion is run without any errors by 'rcctl -d start salt_minion' and 
> > reports ok, but actually no python-3.8, no salt is run according to ps. 
> > /var/log/salt/minon is clean too.
> > After testing I can conclude salt 3001 minion can't run without swap as 
> > salt's previous version.
> > Martin
>
> Hi Martin,
>
> I could reproduce this by simply disabling swap on a running system: `swapctl 
> -d /dev/sd0b`
> and restarting the minion.
>
> I'll commit the attached patch to -current, if you're not on -current you 
> should be able
> to backport it to an older release without too much effort.
>
> Cheers,
> Jasper
>
> Index: salt/grains/core.py
> --- salt/grains/core.py.orig
> +++ salt/grains/core.py
> @@ -525,7 +525,7 @@ def _bsd_memdata(osdata):
> if osdata["kernel"] in ["OpenBSD", "NetBSD"]:
> swapctl = salt.utils.path.which("swapctl")
> swap_data = salt["cmd.run"]("{0} -sk".format(swapctl))
>
> -              if swap_data == "no swap devices configured":
>
>
>
> -              if re.match(r"(swapctl: )?no swap devices configured", 
> swap_data):
>                    swap_total = 0
>                else:
>                    swap_total = swap_data.split(" ")[1]
>
>


Reply via email to