Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 25th November 2011, 10:24 PM
acorlato Offline
Registered User
 
Join Date: Mar 2010
Posts: 52
linuxfirefox
FC 16: how to change simple init.d - script to systemd

Thanks to the compatibility of systemd to sysV I use a simple start routine that purges /tmp in FC 16. The command line

/usr/sbin/tmpwatch -m -Maq 24h /tmp

is the only action which is done by the init.d script (just once, no daemon service).

Is there anyone who can explain to me how to implement this in systemd style?

---------- Post added at 11:24 PM ---------- Previous post was at 10:11 PM ----------

Quote:
Originally Posted by acorlato View Post
Thanks to the compatibility of systemd to sysV I use a simple start routine that purges /tmp in FC 16. The command line

/usr/sbin/tmpwatch -m -Maq 24h /tmp

is the only action which is done by the init.d script (just once, no daemon service).

Is there anyone who can explain to me how to implement this in systemd style?
I found out that there is already a mechanism for it:

>>> cat /lib/systemd/system/systemd-tmpfiles-clean.service

# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

[Unit]
Description=Cleanup of Temporary Directories
DefaultDependencies=no
Wants=local-fs.target
After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target
Before=sysinit.target shutdown.target
ConditionDirectoryNotEmpty=|/usr/lib/tmpfiles.d
ConditionDirectoryNotEmpty=|/usr/local/lib/tmpfiles.d
ConditionDirectoryNotEmpty=|/etc/tmpfiles.d
ConditionDirectoryNotEmpty=|/run/tmpfiles.d

[Service]
Type=oneshot
ExecStart=/bin/systemd-tmpfiles --clean
IOSchedulingClass=idle
Reply With Quote
Reply

Tags
howto, startscript, systemd

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple display of systemd service sequence charlweed Using Fedora 2 13th July 2011 05:34 AM
Systemd compatibility sysv init script stop crigia Using Fedora 0 31st May 2011 01:18 PM
init.d script nico80 Using Fedora 2 6th December 2009 11:52 AM
Init Script Help NDog Using Fedora 2 14th February 2007 02:03 AM


Current GMT-time: 11:06 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat