Code Mozzer

and if you have five seconds to spare, then I'll tell you the story of my life

daemontools Tutorial - run service as daemon. Java Spring Boot and Play Scala Production deployment

• daemontools

daemontools setup

Here will be explained how to setup Daemon Tools for Ubuntu environment, but is similar for other environments too.

What is Daemon Tools:

daemontools is a collection of tools for managing UNIX services. supervise monitors a service, it starts the service and restarts the service if it dies. Setting up a new service is easy, all supervise needs is a directory with a run script that runs the service.

1. install daemontools:

sudo apt-get install daemontools

2. After installation is done we need to make daemontools run on startup and to do that we need to create svscan.conf under /etc/init dir. Content of svscan.conf file is described at Start Daemon Tools .

# svscan - daemontools
# This service starts daemontools
start on runlevel [12345]
stop on runlevel [^12345]
exec /usr/bin/svscanboot

We need now to start svscan service via command

sudo service svscan start

Also make svscan to run on system boot.

svscan.conf explained:

DDD Domain Validation, actually Action Validation

• domain,validation,action,composable,messages


When I talk about DDD domain validation I do not think about problems that we have when dealing with simple requirements like ‘Name is not null’ or ‘Password minimal length is 5 characters’, what I’m thinking about is validating whole actions that happens in our ecosystem. e.g. User Creation, AD Campaign launch, Complex excel file import, etc.

Dealing with complex validation we need to be able to collect all validation states at processing time not just first and return single validation present validation state if there are multiple ones.


3 errors are present at action execution time

we do not want to get just first error [Invalid email], we want to be able to get all errors that can be evaluated on action execution. To achieve that kind of validation, we need to have something like validation state builder and for that purpose we introduced Messages, please rebember it as I would use it quite often.

Messages are concept that I heard from my mentor 5 years ago when he introduced it to support validation and also for various other things that can we do with it, as messages are not just for validation.

In next chapter I will continue to introduce you to Messages concept, which I will use to support Deep Action Validation.

Notice: I will use SCALA for my coding examples.