Unable to stop timer service with preinst script when installing new Debian packageGet the new-version in preinst Debian maintenance scriptinstalling a package from debian/rulesInstall experimental package on debianCancel debian package installation inside preinst scriptInstall linux-headers on debian unable to locate packageDebian packaging: reorder dh_installinit and dh_ucfUnable to install the default jdk package on DebianHow to install a package on Debian 8 Jessie running systemd without starting up the service?Odoo 10 starting wrong with systemd service using config fileUnable to start activeMQ as a service on openSUSE Tumbleweed

Is it really a problem to declare that a visitor to the UK is my "girlfriend", in terms of her successfully getting a Standard Visitor visa?

How to gracefully excuse yourself from a meeting due to emergencies such as a restroom break?

A game of red and black

How do I respond appropriately to an overseas company that obtained a visa for me without hiring me?

May a hotel provide accommodation for fewer people than booked?

Should students have access to past exams or an exam bank?

How is Sword Coast North governed?

Best Ergonomic Design for a handheld ranged weapon

Accurately recalling the key - can everyone do it?

What is the significance of $(logname)?

Went to a big 4 but got fired for underperformance in a year recently - Now every one thinks I'm pro - How to balance expectations?

Why don't short runways use ramps for takeoff?

A conjectural trigonometric identity

PI 4 screen rotation from the terminal

Security measures that could plausibly last 150+ years?

Can living where magnetic ore is abundant provide any protection from cosmic radiation?

Were there any unmanned expeditions to the moon that returned to Earth prior to Apollo?

Why are prop blades not shaped like household fan blades?

Is there anyway to harden soft braised carrots?

Why do we need a voltage divider when we get the same voltage at the output as the input?

Skipping same old introductions

How to prevent a single-element caster from being useless against immune foes?

Is Norway in the Single Market?

Why doesn't this proof show that the operation on a factor group is well-defined?



Unable to stop timer service with preinst script when installing new Debian package


Get the new-version in preinst Debian maintenance scriptinstalling a package from debian/rulesInstall experimental package on debianCancel debian package installation inside preinst scriptInstall linux-headers on debian unable to locate packageDebian packaging: reorder dh_installinit and dh_ucfUnable to install the default jdk package on DebianHow to install a package on Debian 8 Jessie running systemd without starting up the service?Odoo 10 starting wrong with systemd service using config fileUnable to start activeMQ as a service on openSUSE Tumbleweed






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















My directory structure is like so:



.
├── src/main/java
│   └── my code
├── scripts/install
│   ├── preinst.sh
│   └── postinst.sh
├── scripts/systemd
│   ├── my-app.service
│   └── my-app.timer
├── build.gradle.kts
└── settings.gradle.kts


My app runs as a service on an interval defined in /etc/systemd/system/my-app.timer.



I am packaging my app into a Debian package for install and would like to:



  1. Stop the timer before installing the new package.

  2. Install the new package.

  3. Start the timer after the new package is installed.

The postinst.sh works great and executes every time, however the preinst.sh script never seems to be executed.



preinst.sh



#!/bin/bash

echo "Stopping my-app.timer"
systemctl stop my-app.timer


postinst.sh



#!/bin/bash

echo "Starting my-app.timer"
systemctl start my-app.timer


build.gradle.kts



tasks.buildDeb 
val deployDir = "/opt/my-app"
val confDir = "/etc/$deployDir"
val config = if (project.properties["config"] == null) "dev" else project.properties["config"]
val systemdDir = "/etc/systemd/system"

packageName = project.name
version = project.version.toString().replace("-SNAPSHOT", "")

user = "root"
group = "root"

// copy to lib
from("$buildDir/libs")
into(deployDir)


// copy to conf
from("$projectDir/conf")
when (config)
"dev" -> include("*-dev.properties")
"test" -> include("*-test.properties")
"prod" -> include("*-prod.properties")


into(confDir)


from("$projectDir/src/test/resources")
into(confDir)


from("$projectDir/scripts/systemd")
into(systemdDir)


preInstall(File("$projectDir/scripts/install/preinst.sh"))
postInstall(File("$projectDir/scripts/install/postinst.sh"))



How can I ensure that my-app.timer is stopped before installing the new package?










share|improve this question






























    0















    My directory structure is like so:



    .
    ├── src/main/java
    │   └── my code
    ├── scripts/install
    │   ├── preinst.sh
    │   └── postinst.sh
    ├── scripts/systemd
    │   ├── my-app.service
    │   └── my-app.timer
    ├── build.gradle.kts
    └── settings.gradle.kts


    My app runs as a service on an interval defined in /etc/systemd/system/my-app.timer.



    I am packaging my app into a Debian package for install and would like to:



    1. Stop the timer before installing the new package.

    2. Install the new package.

    3. Start the timer after the new package is installed.

    The postinst.sh works great and executes every time, however the preinst.sh script never seems to be executed.



    preinst.sh



    #!/bin/bash

    echo "Stopping my-app.timer"
    systemctl stop my-app.timer


    postinst.sh



    #!/bin/bash

    echo "Starting my-app.timer"
    systemctl start my-app.timer


    build.gradle.kts



    tasks.buildDeb 
    val deployDir = "/opt/my-app"
    val confDir = "/etc/$deployDir"
    val config = if (project.properties["config"] == null) "dev" else project.properties["config"]
    val systemdDir = "/etc/systemd/system"

    packageName = project.name
    version = project.version.toString().replace("-SNAPSHOT", "")

    user = "root"
    group = "root"

    // copy to lib
    from("$buildDir/libs")
    into(deployDir)


    // copy to conf
    from("$projectDir/conf")
    when (config)
    "dev" -> include("*-dev.properties")
    "test" -> include("*-test.properties")
    "prod" -> include("*-prod.properties")


    into(confDir)


    from("$projectDir/src/test/resources")
    into(confDir)


    from("$projectDir/scripts/systemd")
    into(systemdDir)


    preInstall(File("$projectDir/scripts/install/preinst.sh"))
    postInstall(File("$projectDir/scripts/install/postinst.sh"))



    How can I ensure that my-app.timer is stopped before installing the new package?










    share|improve this question


























      0












      0








      0








      My directory structure is like so:



      .
      ├── src/main/java
      │   └── my code
      ├── scripts/install
      │   ├── preinst.sh
      │   └── postinst.sh
      ├── scripts/systemd
      │   ├── my-app.service
      │   └── my-app.timer
      ├── build.gradle.kts
      └── settings.gradle.kts


      My app runs as a service on an interval defined in /etc/systemd/system/my-app.timer.



      I am packaging my app into a Debian package for install and would like to:



      1. Stop the timer before installing the new package.

      2. Install the new package.

      3. Start the timer after the new package is installed.

      The postinst.sh works great and executes every time, however the preinst.sh script never seems to be executed.



      preinst.sh



      #!/bin/bash

      echo "Stopping my-app.timer"
      systemctl stop my-app.timer


      postinst.sh



      #!/bin/bash

      echo "Starting my-app.timer"
      systemctl start my-app.timer


      build.gradle.kts



      tasks.buildDeb 
      val deployDir = "/opt/my-app"
      val confDir = "/etc/$deployDir"
      val config = if (project.properties["config"] == null) "dev" else project.properties["config"]
      val systemdDir = "/etc/systemd/system"

      packageName = project.name
      version = project.version.toString().replace("-SNAPSHOT", "")

      user = "root"
      group = "root"

      // copy to lib
      from("$buildDir/libs")
      into(deployDir)


      // copy to conf
      from("$projectDir/conf")
      when (config)
      "dev" -> include("*-dev.properties")
      "test" -> include("*-test.properties")
      "prod" -> include("*-prod.properties")


      into(confDir)


      from("$projectDir/src/test/resources")
      into(confDir)


      from("$projectDir/scripts/systemd")
      into(systemdDir)


      preInstall(File("$projectDir/scripts/install/preinst.sh"))
      postInstall(File("$projectDir/scripts/install/postinst.sh"))



      How can I ensure that my-app.timer is stopped before installing the new package?










      share|improve this question














      My directory structure is like so:



      .
      ├── src/main/java
      │   └── my code
      ├── scripts/install
      │   ├── preinst.sh
      │   └── postinst.sh
      ├── scripts/systemd
      │   ├── my-app.service
      │   └── my-app.timer
      ├── build.gradle.kts
      └── settings.gradle.kts


      My app runs as a service on an interval defined in /etc/systemd/system/my-app.timer.



      I am packaging my app into a Debian package for install and would like to:



      1. Stop the timer before installing the new package.

      2. Install the new package.

      3. Start the timer after the new package is installed.

      The postinst.sh works great and executes every time, however the preinst.sh script never seems to be executed.



      preinst.sh



      #!/bin/bash

      echo "Stopping my-app.timer"
      systemctl stop my-app.timer


      postinst.sh



      #!/bin/bash

      echo "Starting my-app.timer"
      systemctl start my-app.timer


      build.gradle.kts



      tasks.buildDeb 
      val deployDir = "/opt/my-app"
      val confDir = "/etc/$deployDir"
      val config = if (project.properties["config"] == null) "dev" else project.properties["config"]
      val systemdDir = "/etc/systemd/system"

      packageName = project.name
      version = project.version.toString().replace("-SNAPSHOT", "")

      user = "root"
      group = "root"

      // copy to lib
      from("$buildDir/libs")
      into(deployDir)


      // copy to conf
      from("$projectDir/conf")
      when (config)
      "dev" -> include("*-dev.properties")
      "test" -> include("*-test.properties")
      "prod" -> include("*-prod.properties")


      into(confDir)


      from("$projectDir/src/test/resources")
      into(confDir)


      from("$projectDir/scripts/systemd")
      into(systemdDir)


      preInstall(File("$projectDir/scripts/install/preinst.sh"))
      postInstall(File("$projectDir/scripts/install/postinst.sh"))



      How can I ensure that my-app.timer is stopped before installing the new package?







      gradle debian build.gradle systemd






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 23:39









      raphattackraphattack

      425 bronze badges




      425 bronze badges

























          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367713%2funable-to-stop-timer-service-with-preinst-script-when-installing-new-debian-pack%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367713%2funable-to-stop-timer-service-with-preinst-script-when-installing-new-debian-pack%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현