creating a .deb package and autorun it

Clash Royale CLAN TAG#URR8PPP
I'm using a Raspberry Pi 2 Model B running the latest Raspbian Stretch Lite 2018-11-13.
I built a program that communicates with a LoRa chip (SX1276) using SPI, gets some data from a temperature sensor and prints the temperature on the screen.
My program consists of only one executable (apart from wiringpi library).
I was searching for a tutorial to make my program a *.deb package. Using this tutorial I managed to build a lora.deb package.
When I installed my lora.deb package sudo dpkg -i lora.deb the executable just deployed in a directory.
How can I make that package automatically run the executable and also run it every time the system boots?
packaging deb
add a comment |
I'm using a Raspberry Pi 2 Model B running the latest Raspbian Stretch Lite 2018-11-13.
I built a program that communicates with a LoRa chip (SX1276) using SPI, gets some data from a temperature sensor and prints the temperature on the screen.
My program consists of only one executable (apart from wiringpi library).
I was searching for a tutorial to make my program a *.deb package. Using this tutorial I managed to build a lora.deb package.
When I installed my lora.deb package sudo dpkg -i lora.deb the executable just deployed in a directory.
How can I make that package automatically run the executable and also run it every time the system boots?
packaging deb
5
Check outsystemdservice files. If your deb package contains a service file, and you add a postinstall script to your package, you can bring up a service after install automatically and on boot.
– datUser
Jan 12 at 20:48
1
See here here for guides to writing systemd unit files, which will be used by systemd (which handles startup) to start your service.
– novice
Jan 13 at 1:00
add a comment |
I'm using a Raspberry Pi 2 Model B running the latest Raspbian Stretch Lite 2018-11-13.
I built a program that communicates with a LoRa chip (SX1276) using SPI, gets some data from a temperature sensor and prints the temperature on the screen.
My program consists of only one executable (apart from wiringpi library).
I was searching for a tutorial to make my program a *.deb package. Using this tutorial I managed to build a lora.deb package.
When I installed my lora.deb package sudo dpkg -i lora.deb the executable just deployed in a directory.
How can I make that package automatically run the executable and also run it every time the system boots?
packaging deb
I'm using a Raspberry Pi 2 Model B running the latest Raspbian Stretch Lite 2018-11-13.
I built a program that communicates with a LoRa chip (SX1276) using SPI, gets some data from a temperature sensor and prints the temperature on the screen.
My program consists of only one executable (apart from wiringpi library).
I was searching for a tutorial to make my program a *.deb package. Using this tutorial I managed to build a lora.deb package.
When I installed my lora.deb package sudo dpkg -i lora.deb the executable just deployed in a directory.
How can I make that package automatically run the executable and also run it every time the system boots?
packaging deb
packaging deb
edited Jan 13 at 14:46
Jeff Schaller
40.1k1054126
40.1k1054126
asked Jan 12 at 20:45
MrBitMrBit
1264
1264
5
Check outsystemdservice files. If your deb package contains a service file, and you add a postinstall script to your package, you can bring up a service after install automatically and on boot.
– datUser
Jan 12 at 20:48
1
See here here for guides to writing systemd unit files, which will be used by systemd (which handles startup) to start your service.
– novice
Jan 13 at 1:00
add a comment |
5
Check outsystemdservice files. If your deb package contains a service file, and you add a postinstall script to your package, you can bring up a service after install automatically and on boot.
– datUser
Jan 12 at 20:48
1
See here here for guides to writing systemd unit files, which will be used by systemd (which handles startup) to start your service.
– novice
Jan 13 at 1:00
5
5
Check out
systemd service files. If your deb package contains a service file, and you add a postinstall script to your package, you can bring up a service after install automatically and on boot.– datUser
Jan 12 at 20:48
Check out
systemd service files. If your deb package contains a service file, and you add a postinstall script to your package, you can bring up a service after install automatically and on boot.– datUser
Jan 12 at 20:48
1
1
See here here for guides to writing systemd unit files, which will be used by systemd (which handles startup) to start your service.
– novice
Jan 13 at 1:00
See here here for guides to writing systemd unit files, which will be used by systemd (which handles startup) to start your service.
– novice
Jan 13 at 1:00
add a comment |
1 Answer
1
active
oldest
votes
change '/usr/bin/something' to '/directory/path/to/deployed/executable' below:
$ cat /etc/systemd/system/something.service
[Unit]
Description = Something Service
After = network.target
[Service]
ExecStart = /usr/bin/something
[Install]
WantedBy = multi-user.target
$ systemctl daemon-reload
$ systemctl enable something
$ systemctl start something
Thank you very much! Reading through all those sites and tutorials I came up to the solution for the whole method. First of all I need to add amyapp.serviceinto my*.debpackage, then I'll have to write a postinst script that will copy themyapp.serviceinto the proper path and enable the service. I'm not quite sure if instead of a copy you just have to add themyapp.serviceinto the*.debpackage with the proper path.
– MrBit
Jan 13 at 12:39
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f494159%2fcreating-a-deb-package-and-autorun-it%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
change '/usr/bin/something' to '/directory/path/to/deployed/executable' below:
$ cat /etc/systemd/system/something.service
[Unit]
Description = Something Service
After = network.target
[Service]
ExecStart = /usr/bin/something
[Install]
WantedBy = multi-user.target
$ systemctl daemon-reload
$ systemctl enable something
$ systemctl start something
Thank you very much! Reading through all those sites and tutorials I came up to the solution for the whole method. First of all I need to add amyapp.serviceinto my*.debpackage, then I'll have to write a postinst script that will copy themyapp.serviceinto the proper path and enable the service. I'm not quite sure if instead of a copy you just have to add themyapp.serviceinto the*.debpackage with the proper path.
– MrBit
Jan 13 at 12:39
add a comment |
change '/usr/bin/something' to '/directory/path/to/deployed/executable' below:
$ cat /etc/systemd/system/something.service
[Unit]
Description = Something Service
After = network.target
[Service]
ExecStart = /usr/bin/something
[Install]
WantedBy = multi-user.target
$ systemctl daemon-reload
$ systemctl enable something
$ systemctl start something
Thank you very much! Reading through all those sites and tutorials I came up to the solution for the whole method. First of all I need to add amyapp.serviceinto my*.debpackage, then I'll have to write a postinst script that will copy themyapp.serviceinto the proper path and enable the service. I'm not quite sure if instead of a copy you just have to add themyapp.serviceinto the*.debpackage with the proper path.
– MrBit
Jan 13 at 12:39
add a comment |
change '/usr/bin/something' to '/directory/path/to/deployed/executable' below:
$ cat /etc/systemd/system/something.service
[Unit]
Description = Something Service
After = network.target
[Service]
ExecStart = /usr/bin/something
[Install]
WantedBy = multi-user.target
$ systemctl daemon-reload
$ systemctl enable something
$ systemctl start something
change '/usr/bin/something' to '/directory/path/to/deployed/executable' below:
$ cat /etc/systemd/system/something.service
[Unit]
Description = Something Service
After = network.target
[Service]
ExecStart = /usr/bin/something
[Install]
WantedBy = multi-user.target
$ systemctl daemon-reload
$ systemctl enable something
$ systemctl start something
answered Jan 13 at 5:12
tkjeftkjef
26125
26125
Thank you very much! Reading through all those sites and tutorials I came up to the solution for the whole method. First of all I need to add amyapp.serviceinto my*.debpackage, then I'll have to write a postinst script that will copy themyapp.serviceinto the proper path and enable the service. I'm not quite sure if instead of a copy you just have to add themyapp.serviceinto the*.debpackage with the proper path.
– MrBit
Jan 13 at 12:39
add a comment |
Thank you very much! Reading through all those sites and tutorials I came up to the solution for the whole method. First of all I need to add amyapp.serviceinto my*.debpackage, then I'll have to write a postinst script that will copy themyapp.serviceinto the proper path and enable the service. I'm not quite sure if instead of a copy you just have to add themyapp.serviceinto the*.debpackage with the proper path.
– MrBit
Jan 13 at 12:39
Thank you very much! Reading through all those sites and tutorials I came up to the solution for the whole method. First of all I need to add a
myapp.service into my *.deb package, then I'll have to write a postinst script that will copy the myapp.service into the proper path and enable the service. I'm not quite sure if instead of a copy you just have to add the myapp.service into the *.deb package with the proper path.– MrBit
Jan 13 at 12:39
Thank you very much! Reading through all those sites and tutorials I came up to the solution for the whole method. First of all I need to add a
myapp.service into my *.deb package, then I'll have to write a postinst script that will copy the myapp.service into the proper path and enable the service. I'm not quite sure if instead of a copy you just have to add the myapp.service into the *.deb package with the proper path.– MrBit
Jan 13 at 12:39
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f494159%2fcreating-a-deb-package-and-autorun-it%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
5
Check out
systemdservice files. If your deb package contains a service file, and you add a postinstall script to your package, you can bring up a service after install automatically and on boot.– datUser
Jan 12 at 20:48
1
See here here for guides to writing systemd unit files, which will be used by systemd (which handles startup) to start your service.
– novice
Jan 13 at 1:00