Systemd - help with creating a service file

Hi, I am trying to make a service file to execute "devmon --no-mount --exec-on-audio abcde". Basicly I want abcde to run when an audio cd is inserted into a headless computer. I have tried some udev rules but had no luck with that.
I then found udevil and devmon, and it seems to do exectly what I want.
So Ive made a systemd service file and put it in to /usr/lib/systemd/system
here is it:
/usr/lib/systemd/system/abcde-auto.service
[Unit]
Description=Virtual Distributed Ethernet
[Service]
Type=simple
ExecStart=/usr/bin/devmon --no-mount --exec-on-audio abcde
[Install]
WantedBy=multi-user.target
I have started this with
systemctl start abcde-auto.service
and I see that a devmon process has started with the same arguments I gave in the service file, so all is good.
But now, I am not too sure about the "Type" in the service file, devmon starts abcde, but:
systemctl stop abcde-auto.service
does not stop abcde, only devmon.
Is there a way to setup the service file so that abcde will end as well as devmon?
*Edit
Ive read this http://www.freedesktop.org/software/sys … rvice.html but Im still not too sure. Dont really know what most of it means.
Last edited by jrussell (2012-10-20 18:09:23)

I use type 'oneshot' and add an ExecStop= to start and stop scripts.
Like here is the unit file I use to start and stop arno-iptables-firewall
[Unit]
Description=Arno iptables firewall
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/arno-iptables-firewall start
ExecStop=/usr/sbin/arno-iptables-firewall stop
[Install]
WantedBy=multi-user.target

Similar Messages

  • Help with creating a jar file

    hi sorry if this is not the place to post the topic but was not sure where to post it.
    i have make an application that has some images and a database but i would like to make a "exe" or somthing so that the client dose not have to open an ide and click run. they can just double click on somting. am not sure about how most of you distrbute your apps. can you help me please.
    the client will be useing windows 95.
    i know that a jar file can do this but i am not sure on how to change the refrences in the code to include the images and every thing. and how would i go about getting it into jar form
    thanks nibur

    You can create an executable jar.
    Note that even if you do this, the user will need to have a JRE installed on their machine for this to run.
    Here's how you can make this executable jar:
    Replace all code that refers to the filesystem (like if you do "File f = new File("c:\myDirectory\file.txt");") to use resources:
    http://java.sun.com/j2se/1.4.2/docs/guide/resources/index.html
    Create a manifest file that has a Main-Class: attribute.
    Then use the "jar" tool to create the jar:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/jar.html
    That doc has "see also" links at the bottom that can tell you about executable jars and manifest files.
    If you're using an IDE, the IDE probably has a tool to create jars for you. In Eclipse, it's under File -> Export. Check your IDE's docs for details.

  • Help with creating a sql file that will capture any database table changes.

    We are in the process of creating DROP/Create tables, and using exp/imp data into the tables (the data is in flat files).
    Our client is bit curious to work with. They do the alterations to their database (change the layout, change the datatype, drops tables) without our knowing. This has created a hell lot of issues with us.
    Is there a way that we can create a sql script which can capture any table changes on the database, so that when the client trys to execute imp batch file, the sql file should first check to see if any changes are made. If made, then it should stop execution and give an error message.
    Any help/suggestions would be highly appreciable.
    Thanks,

    Just to clarify...
    1. DDL commands are like CREATE, DROP, ALTER. (These are different than DML commands - INSERT, UPDATE, DELETE).
    2. The DDL trigger is created at the database level, not on each table. You only need one DDL trigger.
    3. You can choose the DDL commands for which you want the trigger to fire (probably, you'll want CREATE, DROP, ALTER, at a minimum).
    4. The DDL trigger only fires when one of these DDL commands is run.
    Whether you have 50 tables or 50,000 tables is not significant to performance in this context.
    What's signficant is how often you'll be executing the DDL commands on which the trigger is set to fire and whether the DDL commands execute in acceptable time with the trigger in place.

  • I need help with Creating Key Pairs

    Hello,
    I need help with Creating Key Pairs, I generate key pais with aba provider, but the keys generated are not base 64.
    the class is :
    import java.io.*;
    import java.math.BigInteger;
    import java.security.*;
    import java.security.spec.*;
    import java.security.interfaces.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import au.net.aba.crypto.provider.ABAProvider;
    class CreateKeyPairs {
    private static KeyPair keyPair;
    private static KeyPairGenerator pairGenerator;
    private static PrivateKey privateKey;
    private static PublicKey publicKey;
    public static void main(String[] args) throws Exception {
    if (args.length != 2) {
    System.out.println("Usage: java CreateKeyParis public_key_file_name privete_key_file_name");
    return;
    createKeys();
    saveKey(args[0],publicKey);
    saveKey(args[1],privateKey);
    private static void createKeys() throws Exception {
    Security.addProvider(new ABAProvider());
    pairGenerator = KeyPairGenerator.getInstance("RSA","ABA");
    pairGenerator.initialize(1024, new SecureRandom());
    keyPair = pairGenerator.generateKeyPair();
    privateKey = keyPair.getPrivate();
    publicKey = keyPair.getPublic();
    private synchronized static void saveKey(String filename,PrivateKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream(new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    private synchronized static void saveKey(String filename,PublicKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream( new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    the public key is:
    �� sr com.sun.rsajca.JSA_RSAPublicKeyrC��� xr com.sun.rsajca.JS_PublicKey~5< ~��% L thePublicKeyt Lcom/sun/rsasign/p;xpsr com.sun.rsasign.anm����9�[ [ at [B[ bq ~ xr com.sun.rsasign.p��(!g�� L at Ljava/lang/String;[ bt [Ljava/lang/String;xr com.sun.rsasign.c�"dyU�|  xpt Javaur [Ljava.lang.String;��V��{G  xp   q ~ ur [B���T�  xp   ��ccR}o���[!#I����lo������
    ����^"`8�|���Z>������&
    d ����"B��
    ^5���a����jw9�����D���D�)�*3/h��7�|��I�d�$�4f�8_�|���yuq ~
    How i can generated the key pairs in base 64 or binary????
    Thanxs for help me
    Luis Navarro Nu�ez
    Santiago.
    Chile.
    South America.

    I don't use ABA but BouncyCastle
    this could help you :
    try
    java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
    java.security.KeyPairGenerator kg = java.security.KeyPairGenerator.getInstance("RSA","BC");
    java.security.KeyPair kp = kg.generateKeyPair();
    java.security.Key pub = kp.getPublic();
    java.security.Key pri = kp.getPrivate();
    System.out.println("pub: " + pub);
    System.out.println("pri: " + pri);
    byte[] pub_e = pub.getEncoded();
    byte[] pri_e = pri.getEncoded();
    java.io.PrintWriter o;
    java.io.DataInputStream i;
    java.io.File f;
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pub64"));
    o.println(new sun.misc.BASE64Encoder().encode(pub_e));
    o.close();
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pri64"));
    o.println(new sun.misc.BASE64Encoder().encode(pri_e));
    o.close();
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.FileReader("d:/pub64"));
    StringBuffer keyBase64 = new StringBuffer();
    String line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] pubBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    br = new java.io.BufferedReader(new java.io.FileReader("d:/pri64"));
    keyBase64 = new StringBuffer();
    line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] priBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    java.security.KeyFactory kf = java.security.KeyFactory.getInstance("RSA","BC");
    java.security.Key pubKey = kf.generatePublic(new java.security.spec.X509EncodedKeySpec(pubBytes));
    System.out.println("pub: " + pubKey);
    java.security.Key priKey = kf.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(priBytes));
    System.out.println("pri: " + priKey);
    catch(Exception e)
    e.printStackTrace ();
    }

  • Help with creating a form, I want to add a check box to enable me to unlock certain fields and deselect the block again

    Help with creating a form, I want to add a check box to enable me to unlock certain fields and deselect the block again

    Look to the right under "More Like This". Your issue has been discussed many many times. The error you are seeing is because you do not have enough free "contiguous" space on your hard drive. Read the other threads that address this issue to find how to solve the issue.
    Or, put "The disk cannot be partitioned because some files cannot be moved" into the search box at the upper right of this page.

  • I need help with creating PDF with Preview...

    Hello
    I need help with creating PDF documetns with Preview. Just a few days ago, I was able to create PDF files composed of scanned images (notes) and everything worked perfectly fine. However, today I was having trouble with it. I scanned my notebook and saved 8 images/pages in jpeg format. I did the usual routine with Preview (select all files>print>PDF>save as PDF>then save). Well this worked a few days ago, but when I tried it today, I was able to save it, but the after opening the PDF file that I have saved, only the first page was there. The other pages weren't included. I really don't see anything wrong with what I'm doing. I really need help. Any help would be greatly appreciated.

    I can't find it.  I went into advanced and then document processing but no batch sequence is there and everything is grayed out.
    EDIT: I realized that you cant do batch sequences in standard.  Any other ideas?

  • Help with converting a Nero file

    I have previously converted a dvd insert designed with Nero into a pdf using adobe acrobat in order to send to someone else.  When I tried to do the same thing today with a new Nero designed insert the conversion wouldn't work.  The message said adobe didn't support the program that created the file.  Any ideas?

    thanks for your response.
    When I create a dvd insert or cd label etc using Nero the file extension is nct - nero cover template.  The printer wants the file as a pdf as he can't open Nero files.  I have version 9.3 of acrobat.
    Date: Mon, 18 Jan 2010 21:43:47 -0700
    From: [email protected]
    To: [email protected]
    Subject: help with converting a Nero file
    Nero is simply a CD/DVD burning application and should have no effect on the type of files that will eventually be on the CD/DVD.
    What type of files are you trying to convert and exactly how are you trying to convert them? Plus, it would help to know the version of Acrobat you are using.
    >

  • ITS 620 - how to create a service file for SAPGUI for HTML option

    Hi,
    We have the following configuration :
    ITS 620 installed
    IIS webserver
    NTLM Authentication on webserver
    SAP 46C
    We have some reports that use the IACs option of creating ITS reports and we are able to create the service files using webstudio where we can save a service id and password so that when the ITS page is called, it logs on the user directly into the system.
    Now, we are trying to create a new ITS page for a custom Z transaction and would like to use the SAPGUI for HTML option so that we do not have to use Webstudio to create and modify the HTML pages.
    When I call the ITS page for the new transaction, it brings up the logon screen for the user, which we want to avoid. If I create a new service file for this Z transaction without any HTML pages then I get an error.
    Is there a way to copy the WEBGUI.SRVC file to a custome SRVC file, I tried to create to copy it to a test file called ZTEST.SRVC for my test transaction called ZTEST and now I get an error.
    thanks in advance
    N.S.

    Hello N.S.
    You can create a service file, like ZSERVICE.SRVC.  The parameters should be:
    ~webgui 1
    ~transaction ztransaction
    ~client  001
    ~login   username
    ~password  password
    ~language  EN
    The "~webgui 1" allows the ITS to use the Webgui to dynamically generate the page (no IAC needed.)
    The "~transaction" is the transaction code of your service.
    The "~client" is the client number.
    The "~login" is the username.
    The "~password" is the user's password.
    the "~language" is the language for the users.
    Note that the last four are required for automatic logon.  If end users use a variety of languages though the ~language can be prepended to the URL to support different languages.  (Leave it blank in the srvc file then.)
    Edgar

  • Help with creating a Quiz

    Hey i need help with creating a quiz with scoring and all.
    I need a helping hand so if you can get me started that
    would help a lot.
    Use the Question class to define a Quiz class. A
    quiz can be composed of up to 25 questions. Define the add method
    of the Quiz class to add a question to a quiz. Define the giveQuiz
    method of the Quiz class to present each question in turn to the user,
    accept an answer for each one, and keep track of the results. Define
    a class called QuizTime with a main method that populates a quiz,
    presents it, and prints the final results.
    // Question.java Author: Lewis/Loftus/Cocking
    // Represents a question (and its answer).
    public class Question implements Complexity
    private String question, answer;
    private int complexityLevel;
    // Sets up the question with a default complexity.
    public Question (String query, String result)
    question = query;
    answer = result;
    complexityLevel = 1;
    // Sets the complexity level for this question.
    public void setComplexity (int level)
    complexityLevel = level;
    // Returns the complexity level for this question.
    public int getComplexity()
    return complexityLevel;
    // Returns the question.
    public String getQuestion()
    return question;
    // Returns the answer to this question.
    public String getAnswer()
    return answer;
    // Returns true if the candidate answer matches the answer.
    public boolean answerCorrect (String candidateAnswer)
    return answer.equals(candidateAnswer);
    // Returns this question (and its answer) as a string.
    public String toString()
    return question + "\n" + answer;
    }

    Do you know why this lazy f&#97;rt-&#97;ss is back? Because when he posted his homework last week, some sorry-assed idiot went and did it for him.
    http://forum.java.sun.com/thread.jspa?threadID=5244564&messageID=10008358#10008358
    He didn't even thank the poster.
    It's the same problem over and over again. You feed the bears and it only teaches them to come back for handouts.
    My polite suggestion to the original poster: please do your own f&#117;cking homework.

  • Need help with creating a brush

    Hi guys,
    I wanted to ask for help with creating a brush (even a link to a tutorial will be goon enough ).
    I got this sample:
    I've created a brush from it, and i'm trying to get this kind of result:
    but it's only duplicates it and gives me this result:
    Can someone help me please understand what i need to define in order to make the brush behave like a continues brush instead of duplicate it?
    Thank you very much
    shlomit

    what you need to do is make a brush that looks like the tip of a brush. photoshop has several already but you can make your own that will be better.
    get a paintbrush and paint a spot kind of like what you did but dont paint a stroke. make it look kindof grungy. then make your brush from that, making sure to desaturate it and everything.
    EDIT:
    oh, and if you bring the fill down to like 10-20% your stroke will look better

  • Pacman should run `systemd daemon-reload` when updating .service files

    Every time pacman updates a service like ngingx; I would like to restart that service to propagate the changes. However; systemd always complains that the service file was updated. It would be nice if pacman would do this for me. Is it possible to extend pacman in userland, so I can execute this command whenever a .service file is touched? Or should I write a pacman wrapper that uses inotify to detect this?
    Anyone knows if this is currently possible? I'm also interested in feedback; I'll post a feature-request on the bugtracker depending on your replies
    Last edited by Spider.007 (2013-11-23 13:32:54)

    graysky wrote:Glad to hear the underlying code is coming together.  I have noticed that nfs exports simply stop working when the nfs-utils package is updated, so having the underlying services restart after the update would be a welcomed addition.
    You could have systemd watch for changes to a relevant file or directory and restart the service. Not as neat but possibly useful if you haven't thought of it already.

  • I had to put my computer by together without migration or time machine I NEED help with order of the files?

    I had to put my computer by together without migration or time machine I NEED help with order of the files?

    Hi, where are these other files exactly?

  • I need help with creating some formulas

    I'm not sure if anyone around here can help me, but I'm trying to create a Numbers document and need some help with creating a formula/function.
    I have a column of amounts and I would like to create a formula which deducts a percentage (11.9%) and puts the result in another column.
    If anyone can help me, it would be greatly appreciated.

    Here is an example that shows one way to do this:
    The original data is in column A.  In column B we will store formulas to adjust the amounts:
    1) select the cell where you want to formula (in this case cell B2)
    2) Type the "=" (equal sign):
    3) click cell A2:
    4) now type the rest of the formula which is: "*(100-11.9)/100"  that is asterisk, then open parenthesis, 100 minus eleven point nine close parenthesis forward slash  one hundred
    The Asterisk is the multiply operator  (times) and the forward slash is the division operator (divide)
    now hit return.  select cell B2 and hover the cursor over the bottom edge of the cell:
    drag the little yellow dot down to "fill" the formula down as needed.

  • Help on creating a jar file

    I created a game and I need help on creating a jar file.
    I know the basics such as having a root folder, a manifest file and what goes in it, etc. And I know some programs like JGrasp can do the jar file for you, but it tells me it cannot find the main class. Does anybody know another program that can do that for me, or can i easily do it manually?
    any help is appreciated

    You can use jar.exe to create jar files.
    Just type jar and hit enter on the console it will give the help message about parameters.
    if you do not really need to put any spesific menifest information. Just zip the files using some zip software and change the extenction to jar. (Thats what I am doing most of the time)

  • Need urgent help with creating .war file ...

    My boss gave me one day to create an app. that runs on Apache Tomcat 4.0.6. I managed to get it done, but now I'm trying to move it from my machine to the web server. Each time I try to create a .war file I get an error saying "no such file or directory". Am I missing a step here??
    What I do is: go to the webapps/<appname> directory where the app. is located, type in jar cvf * path/to/application/appname.war.
    I then get the "no such file..." message, then a message that says "added manifest" then lines on the screen that say adding: blah blah file. It goes through all the files in my app directory but I get no resulting .war file.
    I'm so frustrated and confused at this point, any help would be greatly appreciated.

    >
    What I do is: go to the webapps/<appname> directory
    where the app. is located, type in jar cvf *
    path/to/application/appname.war. No need to create an intermediate zip file, or to use JDeveloper to create a simple war file.
    You just need to put the WAR name before the list of files.
    jar cvf appName.war *

Maybe you are looking for

  • How can we protect the  ztable non key fields data in sm30 display.

    Hi experts,      I have created tablemaintenence generator for one z table, in sm30 user has access to enter the data. in that maintenence i have to protect the non key field values data  like once the user saves his data.than in the edit mode it has

  • Unknown error -50 syncing iPad2

    I use iMac to sync iPad2 with iTunes 10.4.1 I get the error "Unknow Error (-50)" and it won't sync I've called Apple, they keep asking for money to be able to help me. I  can't find a fix online. I'm not sure what to do with this now useless iPad. He

  • How to send the complete apex page in email.

    Hi All, I have created an apex page which contains 5 sql report region and one IR region. All these regions are dynamic. Now I have created on button to just send an email to the addresses mentioned in the process. Now I want to send this page daily

  • Final Cut Pro 5.1.4 to 6.0.1 and up???

    I have FCP 5.1.4 and would like to know if switching to version 6.0.1 and up would be a update or an upgrade which would mean spending some cash? Some reason my simple question is hard to find an answer to online. Please help, thanks.

  • How can we generate javadocs with Jdev3

    Hello, I'm using JDeveloper3 to create some javabeans. I don't know how I can generate javadocs from JDeveloper3 with JDK1.2.2 Nicolas