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;
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:
- Stop the timer before installing the new package.
- Install the new package.
- 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
add a comment |
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:
- Stop the timer before installing the new package.
- Install the new package.
- 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
add a comment |
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:
- Stop the timer before installing the new package.
- Install the new package.
- 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
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:
- Stop the timer before installing the new package.
- Install the new package.
- 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
gradle debian build.gradle systemd
asked Mar 26 at 23:39
raphattackraphattack
425 bronze badges
425 bronze badges
add a comment |
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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