[Soc-coordination] Report - SysV-init file creator from systemd service files

akhil vij akhil.iiit at gmail.com
Mon Jun 4 08:52:01 UTC 2012


Hi everyone,

Please find my report below.

First Report
========
Project - Sys-V init file creator from systemd service files

Status of the project so far :

The aim of my project is to come up with a Sys-V init file when given
systemd service file as input. As mentioned in my project proposal[0], I
utilized the period of April end and May to study the administrative and
working aspects of Systemd[1].  I also had a look at the documentation for
the modern systemd system[2] and the internals of the old SysV init system.
I also went through this huge discussion thread {"A few observations about
systemd"}[3] on the debian-devel list to better understand systemd's
integration efforts in debian. Then I installed systemd on linux and had a
look at systemd service files. I had a look at the various configuration
parameters in the systemd unit configuration files. Each systemd service
file has 3 sections, namely [Unit], [Service] and [Install] section. Each
of these sections then has some commonly used options. The aim is to parse
these files, get the sections and retrieve all the options. Then, I plan to
use these options to get most of the LSB headers to help me generate LSB
compliant init script.

I am doing the initial development of the converter script in python. For
the purpose of parsing the systemd service file, I am using configparser
class [4] in python.
Currently, the code can exactly identify the sections and the underlying
options. I've started working on the next step - linking each systemd
option to an appropriate bash command. This linking is the main conversion
logic. To get it perfectly right, I plan to experiment with various systemd
service files. I have created an account akhil-guest on alioth. I plan to
upload the first 'dirty' version of the converter on the git repo within
the next few days.

So, summarizing, what I have done :

1. Study the various aspects and design of the systemd init system and read
its documentation.
2. Study the old Sys-V init file format (LSB format) and see how Sys-V
works and how systemd betters it.
3. Study integration efforts of systemd in debian.
4. Study the configuration of Systemd service files and the role of each
section and each available option under each section.
5. Build a python script that parses the service file and extracts each
section and underlying options.
6. Link each option to an appropriate bash command (partially done, will
need a lot more experiments to better the linking and hence, the
conversion).

What I plan to do:
1. Upload first version of the tool(in python) on a git repo within next
few days.
2. Play around with various configuration options in the systemd file and
improve the main conversion logic. Keep updating the tool till we get
reasonably correct
(aiming for atleast 80-90% correctness) Sys-V init script.
3. Rewrite the tool in perl as python is not part of the base system.

References:
[0] :
http://wiki.debian.org/SummerOfCode2012/Projects#SysV-init_file_creator_from_systemd_service_files
[1] : http://0pointer.de/blog/projects/systemd.html
[2] : http://0pointer.de/blog/projects/systemd-docs.html
[3] : http://lists.debian.org/debian-devel/2011/07/msg00269.html
[4] : http://docs.python.org/library/configparser.html

Regards,
Akhil Vij
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/soc-coordination/attachments/20120604/1401ce08/attachment.html>


More information about the Soc-coordination mailing list