Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phi sat 2 #103

Open
wants to merge 173 commits into
base: dev
Choose a base branch
from
Open

Phi sat 2 #103

wants to merge 173 commits into from

Conversation

CesarCoelho
Copy link
Contributor

The changes needed for the Phi-Sat-2 mission.
This involves mainly (1) the creation of NMF Packages via a maven plugin, (2) support of Apps running in isolation by taking advantage of Linux (one user per App)

Copy link
Member

@dmarszk dmarszk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @CesarCoelho - in principle looks good. I found a few things to change.
After the fixups, please ensure to stay compliant with https://github.com/esa/nanosat-mo-framework/blob/dev/CONTRIBUTING.md - most notably use the bug-tracker https://gitlab.com/esa/NMF/nmf-issues for new changes.

LinuxUsersGroups.printCommandAndOutput(cmd3, out3);
}

public static void addUserToGroup(String username, String extraGroup) throws IOException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not look like what it is supposed to do. Adding user to a group is typically done via usermod

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think usermod was not available on our OBC. We have busybox and I guess this was a work around. Check here: https://stackoverflow.com/questions/37791873/how-to-add-user-to-a-group-without-usermod

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linked SO post does not resemble what this method implements. I cannot really match it to either GNU adduser:
https://linux.die.net/man/8/adduser
or busybox adduser:
https://www.busybox.net/downloads/BusyBox.html

@@ -396,6 +407,9 @@ protected boolean isAppRunning(final Long appId)
ret.add(str.toString());
} else {
if (runAs != null) {
if(sudoAvailable){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If sudo is available, sudo su is an antipattern as it escapes the sudoers permission lists - i.e. using sudo + sudoers configuration is the proper way to ensure that supervisor is not running as a privileged user, and thus commands like
su - user123 -c <command> should be replaced with sudo -u user123 <command>. This along with properly tailored system config (i.e. ensuring that user123 belongs to a group which is sudo'able by the supervisor user) will properly utilise linux permissions system.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the thorny one... while I agree with you, there was some problem which prevented me from doing what you are suggesting, can't quite recall it however

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please give it a go. Message me if it gives you issues. Perhaps adding -i switch to sudo is enough in case of problems.

@dmarszk
Copy link
Member

dmarszk commented Aug 30, 2021

Please also rebase on top of dev branch.

.append(withGroup ? " --group " : " ")
.append(username);
}
//String cmd = "useradd $user_nmf_admin -m -s /bin/bash --user-group";
Copy link
Member

@dmarszk dmarszk Dec 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover test code. Remove please.

@dmarszk
Copy link
Member

dmarszk commented Dec 6, 2021

See the latest round of comments. In addition:

@@ -307,7 +307,8 @@ public void takePhotograph(long actionInstanceObjId, int stageOffset, int totalS
new Duration(casMCAdapter.getExposureTime()),
casMCAdapter.getGainRed(),
casMCAdapter.getGainGreen(),
casMCAdapter.getGainBlue());
casMCAdapter.getGainBlue(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API is broken here -> can we patch the StubGenerator to generate multiple constructor wrappers for composites with optional fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I like the idea. Will come with MOv9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants