diff options
author | John L. Whiteman <john.l.whiteman@intel.com> | 2014-09-04 10:38:35 -0700 |
---|---|---|
committer | John L. Whiteman <john.l.whiteman@intel.com> | 2015-01-09 14:04:01 -0700 |
commit | 49111d3b8ffb4a2c330ba05c992a33c115081b95 (patch) | |
tree | 818d49ac024512bebe7538084c8138fac7f2c01b | |
parent | aa88ec7e3a2f929e73191907705e668c9d29558c (diff) | |
download | csf-framework-49111d3b8ffb4a2c330ba05c992a33c115081b95.tar.gz csf-framework-49111d3b8ffb4a2c330ba05c992a33c115081b95.tar.bz2 csf-framework-49111d3b8ffb4a2c330ba05c992a33c115081b95.zip |
Adding dbus/systemd config files to start daemons
Change-Id: I49c668d286f012657c8c41dc4c820e305af7fcb6
Signed-off-by: John L. Whiteman <john.l.whiteman@intel.com>
-rw-r--r-- | packaging/com.tsc.ipc.server.plugin.conf | 13 | ||||
-rw-r--r-- | packaging/com.tsc.ipc.server.wp.conf | 13 | ||||
-rw-r--r-- | packaging/csf-framework.spec | 51 | ||||
-rw-r--r-- | packaging/tpcsserdaemon.service | 11 | ||||
-rw-r--r-- | packaging/twpserdaemon.service | 11 |
5 files changed, 94 insertions, 5 deletions
diff --git a/packaging/com.tsc.ipc.server.plugin.conf b/packaging/com.tsc.ipc.server.plugin.conf new file mode 100644 index 0000000..0be2c8d --- /dev/null +++ b/packaging/com.tsc.ipc.server.plugin.conf @@ -0,0 +1,13 @@ +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + <policy user="root"> + <allow own="com.tsc.ipc.server.plugin"/> + </policy> + <policy at_console="true"> + <allow send_destination="com.tsc.ipc.server.plugin"/> + </policy> + <policy context="default"> + <deny send_destination="com.tsc.ipc.server.plugin"/> + </policy> +</busconfig> diff --git a/packaging/com.tsc.ipc.server.wp.conf b/packaging/com.tsc.ipc.server.wp.conf new file mode 100644 index 0000000..a97c7d6 --- /dev/null +++ b/packaging/com.tsc.ipc.server.wp.conf @@ -0,0 +1,13 @@ +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + <policy user="root"> + <allow own="com.tsc.ipc.server.wp"/> + </policy> + <policy at_console="true"> + <allow send_destination="com.tsc.ipc.server.wp"/> + </policy> + <policy context="default"> + <deny send_destination="com.tsc.ipc.server.wp"/> + </policy> +</busconfig> diff --git a/packaging/csf-framework.spec b/packaging/csf-framework.spec index 0e631d1..07dd913 100644 --- a/packaging/csf-framework.spec +++ b/packaging/csf-framework.spec @@ -7,6 +7,10 @@ Group: Security/Libraries URL: http://tizen.org Source: %{name}-%{version}.tar.gz Source1001: csf-framework.manifest +Source1002: com.tsc.ipc.server.plugin.conf +Source1003: com.tsc.ipc.server.wp.conf +Source1004: tpcsserdaemon.service +Source1005: twpserdaemon.service BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(dlog) @@ -18,6 +22,10 @@ A general purpose content screening and reputation solution. %prep %setup -q cp %{SOURCE1001} . +cp %{SOURCE1002} . +cp %{SOURCE1003} . +cp %{SOURCE1004} . +cp %{SOURCE1005} . %build cd framework @@ -39,17 +47,44 @@ make -f Makefile_TWPSerDaemon all %install rm -rf %{buildroot} -mkdir -p %{buildroot}%{_libdir}/ mkdir -p %{buildroot}%{_bindir}/ +mkdir -p %{buildroot}%{_libdir}/systemd/system +mkdir -p %{buildroot}/%{_sysconfdir}/dbus-1/system.d install -D framework/lib/libsecfw.so %{buildroot}%{_libdir}/ install -D framework/lib/libscclient.so %{buildroot}%{_libdir}/ install -D framework/lib/libscserver.so %{buildroot}%{_libdir}/ install -D framework/bin/TPCSSerDaemon %{buildroot}%{_bindir}/ install -D framework/bin/TWPSerDaemon %{buildroot}%{_bindir}/ +install -m0644 %{SOURCE1002} %{buildroot}%{_sysconfdir}/dbus-1/system.d/ +install -m0644 %{SOURCE1003} %{buildroot}%{_sysconfdir}/dbus-1/system.d/ +install -m0644 %{SOURCE1004} %{buildroot}%{_libdir}/systemd/system/ +install -m0644 %{SOURCE1005} %{buildroot}%{_libdir}/systemd/system/ -%post -p /sbin/ldconfig +%post +/sbin/ldconfig +systemctl daemon-reload +if [ $1 = 1 ]; then + systemctl restart tpcsserdaemon.service + systemctl restart twpserdaemon.service + systemctl enable tpcsserdaemon.service -q + systemctl enable twpserdaemon.service -q +fi -%postun -p /sbin/ldconfig +%preun +if [ $1 = 0 ]; then + systemctl stop tpcsserdaemon.service + systemctl stop twpserdaemon.service + systemctl disable tpcsserdaemon.service -q + systemctl disable twpserdaemon.service -q +fi + +%postun +/sbin/ldconfig +if [ $1 = 0 ]; then + systemctl daemon-reload +fi +rm -fr /usr/bin/tpcs_config.dtd +rm -fr /usr/bin/tpcs_config.xml %files %manifest %{name}.manifest @@ -57,5 +92,11 @@ install -D framework/bin/TWPSerDaemon %{buildroot}%{_bindir}/ %{_libdir}/libsecfw.so %{_libdir}/libscclient.so %{_libdir}/libscserver.so -%attr(755,root,root) %{_bindir}/TPCSSerDaemon -%attr(755,root,root) %{_bindir}/TWPSerDaemon +%defattr(0755,root,root) +%{_bindir}/TPCSSerDaemon +%{_bindir}/TWPSerDaemon +%defattr(0644,root,root) +%config %{_sysconfdir}/dbus-1/system.d/com.tsc.ipc.server.plugin.conf +%config %{_sysconfdir}/dbus-1/system.d/com.tsc.ipc.server.wp.conf +%{_libdir}/systemd/system/tpcsserdaemon.service +%{_libdir}/systemd/system/twpserdaemon.service diff --git a/packaging/tpcsserdaemon.service b/packaging/tpcsserdaemon.service new file mode 100644 index 0000000..db91ec1 --- /dev/null +++ b/packaging/tpcsserdaemon.service @@ -0,0 +1,11 @@ +[Unit] +Description=CSF Tizen Plugin Control Service Daemon (TPCSSerDaemon) + +[Service] +Type=dbus +ExecStart=/usr/bin/TPCSSerDaemon +BusName=com.tsc.ipc.server.plugin +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/packaging/twpserdaemon.service b/packaging/twpserdaemon.service new file mode 100644 index 0000000..815da09 --- /dev/null +++ b/packaging/twpserdaemon.service @@ -0,0 +1,11 @@ +[Unit] +Description=CSF Tizen Web Protection Service Daemon (TWPSerDaemon) + +[Service] +Type=dbus +ExecStart=/usr/bin/TWPSerDaemon +BusName=com.tsc.ipc.server.wp +Restart=always + +[Install] +WantedBy=multi-user.target |