Skip to content

Kuninoto/42_matt-daemon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42_matt-daemon (42Porto - Advanced Cursus)

Done in collaboration with Nuno Machado

Description

Simple UNIX daemon for System-V based systems (using the double fork() technique).

Demonstration

matt-daemon demonstration

Features

  • Handles 3 simultaneous clients sending messages to register on the logfile;
  • "quit" command to close the daemon;
  • Lock and PID file management.

Installing and running

  1. Install required dependencies
sudo apt-get install c++ make
  1. Clone this repository and navigate to its folder
git clone https://github.com/Kuninoto/42_matt-daemon matt-daemon && cd matt-daemon
  1. Build and run (requires root privileges to create folders and files under /var/log and /var/lock)
sudo make run

Useful links

Creating a daemon in Linux
How to create a daemon in Linux
What is a daemon - definition
daemon man
setsid() man
What is the reason for performing a double fork() when creating a daemon
Double fork() - why?
Why fork() twice

License

This project is licensed under the GPL3 license - see the LICENSE file for more details.


Made by Nuno Carvalho (Kuninoto) | nnuno-ca@student.42porto.com