小编Jod*_*oda的帖子

需要任何模板实例

是否可以告诉我的单元文件等待模板单元文件的任何实例(未知实例名称)?

像这样:After = template@*.service

例:

我有这个模板文件(template @ .service):

[Unit]
Description=TemplateFile
After=network.target

[Service]
Type=idle
ExecStart=/bin/sh -c '${JBOSS_HOME}/bin/standalone.sh ${JBOSS_START_OPTS}'
ExecStop=/bin/sh -c '${JBOSS_HOME}/bin/jboss-cli.sh ${JBOSS_STOP_OPTS}'

[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)

我有这个单位文件(other.service):

[Unit]
Description=Other
After=network.target
#Requires=template@[a-zA-Z0-9]*.service

[Service]
Type=idle
Environment=DISPLAY=:0
ExecStart=/usr/bin/gedit
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)

我希望other.service单元仅在至少运行1个模板@ .service实例时运行

templates systemd

5
推荐指数
1
解决办法
397
查看次数

获取systemd的默认限制

有没有办法找出/etc/systemd/system.conf文件中设置的参数的默认值?

systemd-system.conf的手册页只是说:

When run as system instance systemd reads the configuration file
system.conf, otherwise user.conf. These configuration files contain a
few settings controlling basic manager operations.
Run Code Online (Sandbox Code Playgroud)

变量被取消注释(在user.conf + system.conf中),systemd忽略文件/etc/security/limits.conf.

那么,默认值是什么?它们都设置为无限制吗?

linux limit systemd sles

3
推荐指数
1
解决办法
1717
查看次数

android过滤器自定义数组适配器并再次带回旧项目

我实际上试图用文本过滤我的ListView.

如果我输入内容,结果会被过滤,但如果我再次删除我键入的文本,则列表为空.:(

你知道我怎么解决这个问题吗?

这是迄今为止的代码:

public class ResultsArrayAdapter extends ArrayAdapter<SuchErgebnis> {

    Context myContext;
    int layoutResourceId;
    ArrayList<SuchErgebnis> ergebnisListeOriginal = null;
    ArrayList<SuchErgebnis> ergebnisListeGefiltert = null;
    private Filter filter;

    public ResultsArrayAdapter(Context context, int textViewResourceId,
            ArrayList<SuchErgebnis> objects) {
        super(context, textViewResourceId, objects);

        this.myContext = context;
        this.layoutResourceId = textViewResourceId;
        this.ergebnisListeOriginal = objects;
        this.ergebnisListeGefiltert = objects;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View row = convertView;
        ErgebnisHolder eHolder = null;
        SuchErgebnis ergebnis = ergebnisListeGefiltert.get(position);

        if (row == null) // Wird zum ersten Mal …
Run Code Online (Sandbox Code Playgroud)

android listview filter android-arrayadapter

1
推荐指数
1
解决办法
4067
查看次数