You are not logged in.

#1 2020-10-12 22:22:05

hplewis
Member
Registered: 2017-04-26
Posts: 4

PKGBUILD review request: impostor-server

I created an AUR package, `impostor-server` here: https://aur.archlinux.org/packages/impostor-server/

I'm looking back over it some more and I have a few things I would like some feedback on.

1. The .NET 5.0 dependency
1a. Is there a better way to have .NET 5.0 as a dependency? That version is the version used to compile the project, but I don't see 5.0 anywhere in the official repos or the AUR.
1b. Would I also need to remove it afterwards or on uninstall?

2. I used git as a source because the project has a submodule dependency. This isn't supposed to be a package that tracks VCS, though. I want to make sure this is the best way to do this.

3. Separately from this package, I have a systemd service file written for this that I use on my server. Would it make sense to add that as a dependency as well and install that with the package?

Any other feedback is welcome, too. I am just specifically concerned with those three points.

As a side note, before this package, I also made a binary release package, but I feel more confident about that one.

Offline

#2 2020-10-13 12:51:03

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,497

Re: PKGBUILD review request: impostor-server

1.
Using an RC1 candidate for a server applicatioin seems weird, but it's what upstream uses.

Until MS releases .Net 5 (could be months away) , the repo version won't be updated.

The preferred way to use something like that on archlinux is to create a new package for it, called something like  dotnet-core5 .
The current dotnet-core 3.1.8 may be useful as  a starting point.

2.
using git to download something static is acceptable, although it's better to rely on a specific commit then on a tag.
You're using the gitmodule incorrectly though.
https://wiki.archlinux.org/index.php/VC … submodules gives an example.

replace mysubmodule with the real value found in .gitmodules (it will look weird, but upstream chose that name)

3.
Would the service file be usable for others without changes ?


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#3 2020-10-13 15:56:36

hplewis
Member
Registered: 2017-04-26
Posts: 4

Re: PKGBUILD review request: impostor-server

Thanks! I'll work on 1 & 2.

For 3, no. I'd probably also need to create a service user with a homedir somewhere to keep the application config. From what I can tell, the application can get its config from (1) a config in the same working directory as where the application is running, (2) environment variables, and (3) CLI flags.

It does seem like it would be a little dirty to add. I'd have to make a user & homedir for it.

Just for reference, the file is:

[Unit]
Description=Among Us dedicated server
After=network.target

[Service]
Type=simple
User=impostor
WorkingDirectory=/home/impostor
ExecStart=/home/impostor/Impostor.Server
Restart=always

[Install]
WantedBy=multi-user.target

Offline

#4 2020-10-13 16:06:48

hplewis
Member
Registered: 2017-04-26
Posts: 4

Re: PKGBUILD review request: impostor-server

Quick clarification, in the final service file, I probably wouldn't keep the homedir under /home/.

Offline

#5 2020-10-13 16:08:45

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,987

Re: PKGBUILD review request: impostor-server

The other thing that jumps out at me is the provides and conflicts. The provides is saying "this package, impostor-server, is the same as impostor-server". The conflicts is saying "this package, impostor-server, can't be installed at the same time as impostor-server". See how neither one makes sense?

Offline

#6 2020-10-13 16:53:15

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,712

Re: PKGBUILD review request: impostor-server

hplewis wrote:

For 3, no. I'd probably also need to create a service user with a homedir somewhere to keep the application config. From what I can tell, the application can get its config from (1) a config in the same working directory as where the application is running, (2) environment variables, and (3) CLI flags.

It does seem like it would be a little dirty to add. I'd have to make a user & homedir for it.

You can use systemd-sysusers and systemd-tmpfiles for this. See the manpages for sysusers.d and tmpfiles.d

Generally system services like this, use /var/lib/<name>


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2020-10-13 21:13:14

hplewis
Member
Registered: 2017-04-26
Posts: 4

Re: PKGBUILD review request: impostor-server

Scimmia wrote:

The other thing that jumps out at me is the provides and conflicts. The provides is saying "this package, impostor-server, is the same as impostor-server". The conflicts is saying "this package, impostor-server, can't be installed at the same time as impostor-server". See how neither one makes sense?

Oh I think I was a bit confused here. Now I see this is implied by the pkgname. I only added it because I didn't want someone to install the impostor-server-bin package along with this one, as they would conflict. So I would only need this for the -bin package, but not this one, right?

Offline

#8 2020-10-13 21:43:27

progandy
Member
Registered: 2012-05-17
Posts: 3,903

Re: PKGBUILD review request: impostor-server

To your first point: In the AUR there are the packages dotnet-sdk-preview and dotnet-runtime-preview. They have provides entries for dotnet-{runtime,sdk}-5.0  so you could possibly use that as your dependency.

depends=(dotnet-runtime-5.0  ...)
makedepends=(dotnet-sdk-5.0  ...)

https://aur.archlinux.org/packages/?K=dotnet+preview

To 3.: You can experiment with DynamicUser for the service as well. Read the manpage systemd.exec for information like creating permanent storage and possibly bind-mounting a config file from /etc to the location the server wants.

https://jlk.fjfi.cvut.cz/arch/manpages/ … .exec.5.en

Last edited by progandy (2020-10-13 21:59:40)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#9 2020-10-13 22:54:32

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,987

Re: PKGBUILD review request: impostor-server

hplewis wrote:
Scimmia wrote:

The other thing that jumps out at me is the provides and conflicts. The provides is saying "this package, impostor-server, is the same as impostor-server". The conflicts is saying "this package, impostor-server, can't be installed at the same time as impostor-server". See how neither one makes sense?

Oh I think I was a bit confused here. Now I see this is implied by the pkgname. I only added it because I didn't want someone to install the impostor-server-bin package along with this one, as they would conflict. So I would only need this for the -bin package, but not this one, right?

Correct

Offline

Board footer

Powered by FluxBB