Thanks!
I made a few changes to accommodate adding systemd support with or without
(uses a default) specifying a directory.

regards,
Joy

Dan Horák <[email protected]> wrote on 03/14/2012 09:46:37 AM:

> Dan Horák <[email protected]>
> 03/14/2012 09:46 AM
>
> To
>
> [email protected]
>
> cc
>
> Subject
>
> [Opencryptoki-tech] [PATCH] add support for systemd
>
> New configure parameter is introduced (--with-systemdsystemunitdir)
> and when set
> it means that systemd service file will be installed instead of the
> classis initscript.
>
> Signed-off-by: Dan Horák <[email protected]>
> ---
>  .gitignore                |    1 +
>  configure.in              |   12 ++++++++++++
>  misc/Makefile.am          |   16 +++++++++++++---
>  misc/pkcsslotd.service.in |   13 +++++++++++++
>  4 files changed, 39 insertions(+), 3 deletions(-)
>  create mode 100644 misc/pkcsslotd.service.in
>
> diff --git a/.gitignore b/.gitignore
> index d21bac8..fb600a3 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -22,6 +22,7 @@ man/man5/pk_config_data.5
>  man/man7/opencryptoki.7
>  man/man8/pkcsslotd.8
>  misc/pkcsslotd
> +misc/pkcsslotd.service
>  missing
>  testcases/common/libcommon.la
>  testcases/crypto/aes_tests
> diff --git a/configure.in b/configure.in
> index 483a092..577b148 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -175,6 +175,12 @@ AC_ARG_WITH([xcryptolinz],
>     [],
>     [with_xcryptolinz=check])
>
> +dnl --- systemd system unit files location
> +AC_ARG_WITH([systemdsystemunitdir],
> +   AS_HELP_STRING([--with-systemdsystemunitdir@<:@=DIR@:>@],
> [systemd system unit files location]),
> +   [enable_systemd=yes],
> +   [enable_systemd=no])
> +
>  dnl ---
>  dnl ---
>  dnl --- Now that we have all the options, let's check for a valid build
> @@ -495,6 +501,11 @@ AM_CONDITIONAL([ENABLE_DAEMON], [test "x
> $enable_daemon" = "xyes"])
>  dnl --- enable_library
>  AM_CONDITIONAL([ENABLE_LIBRARY], [test "x$enable_library" = "xyes"])
>
> +dnl --- enable systemd and set unit dir
> +AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x$enable_systemd" = "xyes"])
> +unitdir=$with_systemdsystemunitdir
> +AC_SUBST(unitdir)
> +
>  dnl --- enable_icatok
>  if test "x$enable_icatok" = "xyes"; then
>     if test "x$with_libica" != "xyes"; then
> @@ -677,6 +688,7 @@ echo "   Debug build:      $enable_debug"
>  echo "   Testcases:      $enable_testcases"
>  echo "   Daemon build:      $enable_daemon"
>  echo "   Library build:      $enable_library"
> +echo "   Systemd service:        $enable_systemd"
>  echo
>  echo "Enabled token types:"
>  echo "   ICA token:      $enable_icatok"
> diff --git a/misc/Makefile.am b/misc/Makefile.am
> index d0c6e9b..2954483 100644
> --- a/misc/Makefile.am
> +++ b/misc/Makefile.am
> @@ -1,8 +1,17 @@
> -initddir = $(sysconfdir)/rc.d/init.d
> -
> -EXTRA_DIST = pkcsslotd.in
> +EXTRA_DIST = pkcsslotd.in pkcsslotd.service.in
>
>  if ENABLE_DAEMON
> +if ENABLE_SYSTEMD
> +servicedir = $(unitdir)
> +service_SCRIPTS = pkcsslotd.service
> +
> +CLEANFILES = pkcsslotd.service
> +
> +pkcsslotd.service: pkcsslotd.service.in
> +   @SED@ -e s!\@sbindir\@!"@sbindir@"!g < $< > $@-t
> +   mv $@-t $@
> +else
> +initddir = $(sysconfdir)/rc.d/init.d
>  initd_SCRIPTS = pkcsslotd
>
>  CLEANFILES = pkcsslotd
> @@ -12,3 +21,4 @@ pkcsslotd: pkcsslotd.in
>     @CHMOD@ a+x $@-t
>     mv $@-t $@
>  endif
> +endif
> diff --git a/misc/pkcsslotd.service.in b/misc/pkcsslotd.service.in
> new file mode 100644
> index 0000000..3e64363
> --- /dev/null
> +++ b/misc/pkcsslotd.service.in
> @@ -0,0 +1,13 @@
> +[Unit]
> +Description=Daemon which manages cryptographic hardware tokens for
> the openCryptoki package
> +After=syslog.target
> +
> +[Service]
> +Type=forking
> +PIDFile=/var/run/pkcsslotd.pid
> +ExecStartPre=@sbindir@/pkcs11_startup
> +ExecStart=@sbindir@/pkcsslotd
> +
> +[Install]
> +WantedBy=multi-user.target
> +
> --
> 1.7.7.6
>
>
>
------------------------------------------------------------------------------

> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Opencryptoki-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Opencryptoki-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech

Reply via email to