Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [Solved] Is there a way to manually enable a service? (Read 737 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

[Solved] Is there a way to manually enable a service?

I've got an installation dilemma. 
I'm trying to build a vagrant box with Artix dinit using packer. 

Packer wants to have SSH turned on for the virtual disk at boot or it won't be running scripts. 
I get the feeling dinit is designed to need a reboot before one can enable a service,
but I need to enable a service before dinit starts at boot. 

How do I solve this chicken and egg problem?

dinitctl before reboot
Code: [Select]
/usr/bin/ls: cannot access '/run/dinitctl': No such file or directory

Re: Is there a way to manually enable a service?

Reply #1
Code: [Select]
ln -sf /etc/dinit.d/$svc /etc/dinit.d/boot.d/
ARMtix

Re: [Solved] Is there a way to manually enable a service?

Reply #2
Uhmm... I have

Code: [Select]
echo "==> setup.sh: Enable ssh access manually for box.."
/usr/bin/artix-chroot /mnt ln -s /etc/dinit.d/sshd /etc/dinit.d/boot.d/sshd
/usr/bin/install --owner=root --group=root --mode=0644 etc/dinit.d/sshd /mnt /etc/dinit.d/sshd
/usr/bin/install --owner=root --group=root ${INIT_DIR}/scripts/sshd /mnt /etc/dinit.d/scripts/sshd

This works.
I'm not sure what $svc is, but my above code works. 
(I need to run all commands using artix-chroot directly due to packer.)
Unfortunately, I seem to have another issue with packer.  :(

Re: [Solved] Is there a way to manually enable a service?

Reply #3

Code: [Select]
/usr/bin/install --owner=root --group=root --mode=0644 etc/dinit.d/sshd /mnt /etc/dinit.d/sshd
/usr/bin/install --owner=root --group=root ${INIT_DIR}/scripts/sshd /mnt /etc/dinit.d/scripts/sshd

There shouldn't be a space between "/mnt" and the filename that follows it, though, right? If that space is really there, I don't see how that works