Skip to content

Instantly share code, notes, and snippets.

View mocchira's full-sized avatar

yoshiyuki.kanno mocchira

  • tailor.tech
  • Tokyo Japan
View GitHub Profile
@AndreasMadsen
AndreasMadsen / WhatIHaveDone.md
Last active February 13, 2022 16:15
Playing with smartos
@twobitfool
twobitfool / create-smartos-vm.sh
Last active May 28, 2023 01:51
Create a SmartOS VM in VirtualBox
#!/bin/sh
#
# Creates a SmartOS VM in VirtualBox (assuming you alread have VirtualBox installed)
#
# This script will:
# * Download the latest live ISO image of SmartOS
# * Create a VirtualBox VM, or update an existing VM with the latest ISO
# * Configure the VM with a zones disk, and boot it!
#
#

Preparation

Build PLT files. (Get types of core libraries.) The file .dialyzer_plt is created in your home directory. It will take time (more than a minute).

$ dialyzer --build_plt --apps erts kernel stdlib crypto mnesia sasl common_test eunit

Starting from version %version, all LeoFS nodes are running as non-privileged user leofs in official Linux packages. It should work out of the box for new installations and for new nodes on existing installations. However, for existing nodes upgrading to %version (or later) from earlier versions the change might be not seamless. Compared to the usual upgrade procedure described at System Maintenance, extra steps are needed. There are a few options, depending on how the node was configured.

Users that are running installations with default paths (e.g. queue and mnesia in /usr/local/leofs/<version>/leo_*/work, log files in /usr/local/leofs/<version>/leo_*/log, storage data files in /usr/local/leofs/<version>/leo_*) and follow original upgrade procedure should do the following:

  1. During upgrade of node (of any type), after stopping the old version and after copying or moving mnesia / log / queue / data

About environment config files

Starting from version 1.3.3, some environment variables used by launch scripts can be redefined in "environment" config files. They have shell syntax and are read by launch scripts. Their names are:

leo_gateway/etc/leo_gateway.environment
leo_manager_0/etc/leo_manager.environment
leo_manager_1/etc/leo_manager.environment
leo_storage/etc/leo_storage.environment
@maxlapshin
maxlapshin / systemd.erl
Last active December 24, 2022 17:28
Systemd support
-module(systemd).
% This is what you need to adopt systemd in erlang
%
% Do whatever you want license. If you want, you can take this code under terms of MIT license.
-export([ready/0, reloading/0, stopping/0, watchdog/0]).
-export([start_link/0]).
-export([init/1, handle_info/2, terminate/2]).